diff --git a/frappe/desk/form/load.py b/frappe/desk/form/load.py index 1f5c437330..c1429d361f 100644 --- a/frappe/desk/form/load.py +++ b/frappe/desk/form/load.py @@ -100,6 +100,7 @@ def get_docinfo(doc=None, doctype=None, name=None): "assignment_logs": get_comments(doc.doctype, doc.name, 'assignment'), "permissions": get_doc_permissions(doc), "shared": frappe.share.get_users(doc.doctype, doc.name), + "info_logs": get_comments(doc.doctype, doc.name, 'Info'), "share_logs": get_comments(doc.doctype, doc.name, 'share'), "like_logs": get_comments(doc.doctype, doc.name, 'Like'), "views": get_view_logs(doc.doctype, doc.name), diff --git a/frappe/public/icons/timeless/symbol-defs.svg b/frappe/public/icons/timeless/symbol-defs.svg index 2b0cc8b696..d2c162161f 100644 --- a/frappe/public/icons/timeless/symbol-defs.svg +++ b/frappe/public/icons/timeless/symbol-defs.svg @@ -693,4 +693,10 @@ + + + + + + diff --git a/frappe/public/js/frappe/form/footer/form_timeline.js b/frappe/public/js/frappe/form/footer/form_timeline.js index 7b8d36d90b..1da59a2fdf 100644 --- a/frappe/public/js/frappe/form/footer/form_timeline.js +++ b/frappe/public/js/frappe/form/footer/form_timeline.js @@ -139,6 +139,7 @@ class FormTimeline extends BaseTimeline { this.timeline_items.push(...this.get_custom_timeline_contents()); this.timeline_items.push(...this.get_assignment_timeline_contents()); this.timeline_items.push(...this.get_attachment_timeline_contents()); + this.timeline_items.push(...this.get_info_timeline_contents()); this.timeline_items.push(...this.get_milestone_timeline_contents()); } } @@ -269,6 +270,17 @@ class FormTimeline extends BaseTimeline { return assignment_timeline_contents; } + get_info_timeline_contents() { + let info_timeline_contents = []; + (this.doc_info.info_logs || []).forEach(info_log => { + info_timeline_contents.push({ + creation: info_log.creation, + content: `${this.get_user_link(info_log.comment_email)} ${info_log.content}`, + }); + }); + return info_timeline_contents; + } + get_attachment_timeline_contents() { let attachment_timeline_contents = []; (this.doc_info.attachment_logs || []).forEach(attachment_log => { diff --git a/frappe/public/js/frappe/list/base_list.js b/frappe/public/js/frappe/list/base_list.js index 24e14ffc38..beacb136e6 100644 --- a/frappe/public/js/frappe/list/base_list.js +++ b/frappe/public/js/frappe/list/base_list.js @@ -179,7 +179,8 @@ frappe.views.BaseList = class BaseList { 'Calendar': 'calendar', 'Gantt': 'gantt', 'Kanban': 'kanban', - 'Dashboard': 'dashboard' + 'Dashboard': 'dashboard', + 'Map': 'map', }; if (frappe.boot.desk_settings.view_switcher) { @@ -285,6 +286,7 @@ frappe.views.BaseList = class BaseList { } setup_filter_area() { + if (this.hide_filters) return; this.filter_area = new FilterArea(this); if (this.filters && this.filters.length > 0) { @@ -293,6 +295,7 @@ frappe.views.BaseList = class BaseList { } setup_sort_selector() { + if (this.hide_sort_selector) return; this.sort_selector = new frappe.ui.SortSelector({ parent: this.$filter_section, doctype: this.doctype, @@ -410,7 +413,7 @@ frappe.views.BaseList = class BaseList { doctype: this.doctype, fields: this.get_fields(), filters: this.get_filters_for_args(), - order_by: this.sort_selector.get_sql_string(), + order_by: this.sort_selector && this.sort_selector.get_sql_string(), start: this.start, page_length: this.page_length, view: this.view, @@ -821,6 +824,7 @@ frappe.views.view_modes = [ "Image", "Inbox", "Tree", + "Map", ]; frappe.views.is_valid = (view_mode) => frappe.views.view_modes.includes(view_mode); diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 48ae8b1d08..c55ec4b3ab 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -417,11 +417,11 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { get_no_result_message() { let help_link = this.get_documentation_link(); - let filters = this.filter_area.get(); - let no_result_message = filters.length + let filters = this.filter_area && this.filter_area.get(); + let no_result_message = filters && filters.length ? __("No {0} found", [__(this.doctype)]) : __("You haven't created a {0} yet", [__(this.doctype)]); - let new_button_label = filters.length + let new_button_label = filters && filters.length ? __("Create a new {0}", [__(this.doctype)]) : __("Create your first {0}", [__(this.doctype)]); let empty_state_image = @@ -461,7 +461,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { } before_refresh() { - if (frappe.route_options) { + if (frappe.route_options && this.filter_area) { this.filters = this.parse_filters_from_route_options(); frappe.route_options = null; @@ -527,9 +527,9 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { this.view_name ); this.save_view_user_settings({ - filters: this.filter_area.get(), - sort_by: this.sort_selector.sort_by, - sort_order: this.sort_selector.sort_order, + filters: this.filter_area && this.filter_area.get(), + sort_by: this.sort_selector && this.sort_selector.sort_by, + sort_order: this.sort_selector && this.sort_selector.sort_order, }); this.toggle_paging && this.$paging_area.toggle(false); } diff --git a/frappe/public/js/frappe/list/list_view_select.js b/frappe/public/js/frappe/list/list_view_select.js index 826158ff3f..9607be6e90 100644 --- a/frappe/public/js/frappe/list/list_view_select.js +++ b/frappe/public/js/frappe/list/list_view_select.js @@ -123,7 +123,14 @@ frappe.views.ListViewSelect = class ListViewSelect { kanbans => this.setup_kanban_switcher(kanbans) ); } - } + }, + Map: { + condition: this.list_view.settings.get_coords_method || + (this.list_view.meta.fields.find(i => i.fieldname === "latitude") && + this.list_view.meta.fields.find(i => i.fieldname === "longitude")) || + (this.list_view.meta.fields.find(i => i.fieldname === 'location' && i.fieldtype == 'Geolocation')), + action: () => this.set_route("map") + }, }; frappe.views.view_modes.forEach(view => { diff --git a/frappe/public/js/frappe/ui/filters/field_select.js b/frappe/public/js/frappe/ui/filters/field_select.js index ed271a73aa..c362214ce2 100644 --- a/frappe/public/js/frappe/ui/filters/field_select.js +++ b/frappe/public/js/frappe/ui/filters/field_select.js @@ -36,6 +36,18 @@ frappe.ui.FieldSelect = Class.extend({ var item = me.awesomplete.get_item(value); me.$input.val(item.label); }); + this.$input.on("awesomplete-open", () => { + let modal = this.$input.parents('.modal-dialog')[0]; + if (modal) { + $(modal).removeClass("modal-dialog-scrollable"); + } + }); + this.$input.on("awesomplete-close", () => { + let modal = this.$input.parents('.modal-dialog')[0]; + if (modal) { + $(modal).addClass("modal-dialog-scrollable"); + } + }); if(this.filter_fields) { for(var i in this.filter_fields) diff --git a/frappe/public/js/frappe/ui/filters/filter_list.js b/frappe/public/js/frappe/ui/filters/filter_list.js index 0b2218ceda..611ab024bf 100644 --- a/frappe/public/js/frappe/ui/filters/filter_list.js +++ b/frappe/public/js/frappe/ui/filters/filter_list.js @@ -283,6 +283,7 @@ frappe.ui.FilterGroup = class { } get_filter_area_template() { + /* eslint-disable indent */ return $(`
@@ -293,19 +294,23 @@ frappe.ui.FilterGroup = class {
- + ${this.filter_button ? + `` + : '' + }
` ); + /* eslint-disable indent */ } get_filters_as_object() { diff --git a/frappe/public/js/frappe/views/dashboard/dashboard_view.js b/frappe/public/js/frappe/views/dashboard/dashboard_view.js index 5137d840ec..252024463e 100644 --- a/frappe/public/js/frappe/views/dashboard/dashboard_view.js +++ b/frappe/public/js/frappe/views/dashboard/dashboard_view.js @@ -20,6 +20,8 @@ frappe.views.DashboardView = class DashboardView extends frappe.views.ListView { setup_page() { this.hide_sidebar = true; this.hide_page_form = true; + this.hide_filters = true; + this.hide_sort_selector = true; super.setup_page(); } @@ -74,6 +76,10 @@ frappe.views.DashboardView = class DashboardView extends frappe.views.ListView { this.toggle_customization_buttons(false); } + set_primary_action() { + // Don't render Add doc button for dashboard view + } + toggle_customization_buttons(show) { this.save_customizations_button.toggle(show); this.discard_customizations_button.toggle(show); diff --git a/frappe/public/js/frappe/widgets/chart_widget.js b/frappe/public/js/frappe/widgets/chart_widget.js index 104c457991..01314b436f 100644 --- a/frappe/public/js/frappe/widgets/chart_widget.js +++ b/frappe/public/js/frappe/widgets/chart_widget.js @@ -573,14 +573,17 @@ export default class ChartWidget extends Widget { xIsSeries: this.chart_doc.timeseries, shortenYAxisNumbers: 1 }, - tooltipOptions: { + }; + + if (this.report_result && this.report_result.chart) { + chart_args.tooltipOptions = { formatTooltipY: value => frappe.format(value, { fieldtype: this.report_result.chart.fieldtype, options: this.report_result.chart.options }, { always_show_decimals: true, inline: true }) - } - }; + }; + } if (this.chart_doc.type == "Heatmap") { const heatmap_year = parseInt(this.selected_heatmap_year || this.chart_settings.heatmap_year || this.chart_doc.heatmap_year); diff --git a/frappe/public/scss/desk/list.scss b/frappe/public/scss/desk/list.scss index b7a195718e..ea3401b09e 100644 --- a/frappe/public/scss/desk/list.scss +++ b/frappe/public/scss/desk/list.scss @@ -332,10 +332,6 @@ input.list-check-all, input.list-row-checkbox { } .page-form { - // .awesomplete > ul { - // min-width: 300px; - // } - .standard-filter-section { flex-wrap: wrap; // width: 65%; diff --git a/frappe/public/scss/desk/page.scss b/frappe/public/scss/desk/page.scss index 85831dc2a0..65d535facc 100644 --- a/frappe/public/scss/desk/page.scss +++ b/frappe/public/scss/desk/page.scss @@ -117,6 +117,10 @@ display: none; } } + + .awesomplete > ul { + min-width: 300px; + } } .form-inner-toolbar {