diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index 9fe573afc5..9bbb6ab3c4 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1,18 +1,18 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 1, - "beta": 0, - "creation": "2014-03-11 14:55:00", - "custom": 0, - "description": "Represents a User in the system.", - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 0, - "engine": "InnoDB", + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 1, + "allow_rename": 1, + "beta": 0, + "creation": "2014-03-11 14:55:00", + "custom": 0, + "description": "Represents a User in the system.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 0, + "engine": "InnoDB", "fields": [ { "allow_bulk_edit": 0, @@ -243,37 +243,37 @@ "set_only_once": 0, "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "full_name", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Full Name", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "full_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 0, + "in_standard_filter": 1, + "label": "Full Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2257,25 +2257,25 @@ "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "fa fa-user", - "idx": 413, - "image_field": "user_image", - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 5, - "menu_index": 0, - "modified": "2018-10-21 16:19:54.545733", - "modified_by": "Administrator", - "module": "Core", - "name": "User", - "owner": "Administrator", + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "fa fa-user", + "idx": 413, + "image_field": "user_image", + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 5, + "menu_index": 0, + "modified": "2018-11-06 12:41:33.864058", + "modified_by": "Administrator", + "module": "Core", + "name": "User", + "owner": "Administrator", "permissions": [ { "amend": 0, @@ -2326,4 +2326,4 @@ "track_changes": 1, "track_seen": 0, "track_views": 0 -} \ No newline at end of file +} diff --git a/frappe/hooks.py b/frappe/hooks.py index 0c1e56a4d5..3b9eee6604 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -12,7 +12,7 @@ source_link = "https://github.com/frappe/frappe" app_license = "MIT" develop_version = '12.x.x-develop' -staging_version = '11.0.3-beta.21' +staging_version = '11.0.3-beta.22' app_email = "info@frappe.io" diff --git a/frappe/public/js/frappe/form/controls/dynamic_link.js b/frappe/public/js/frappe/form/controls/dynamic_link.js index f62f1432fe..02e970091e 100644 --- a/frappe/public/js/frappe/form/controls/dynamic_link.js +++ b/frappe/public/js/frappe/form/controls/dynamic_link.js @@ -13,7 +13,7 @@ frappe.ui.form.ControlDynamicLink = frappe.ui.form.ControlLink.extend({ let input = null; if (cur_list) { // for list page - input = cur_list.wrapper.find(selector); + input = cur_list.filter_area.standard_filters_wrapper.find(selector); } if (cur_page) { input = $(cur_page.page).find(selector); diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index deb7f1fedf..fbf185301c 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -50,18 +50,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { if (frappe.route_options) { // Priority 1: route filters - let filters = []; - for (let key in frappe.route_options) { - let value = frappe.route_options[key]; - if (value.startsWith('[') && value.endsWith(']')) { - value = JSON.parse(value); - } else { - value = ['=', value]; - } - filters.push([this.doctype, key, ...value]) - } - this.filters = filters; - frappe.route_options = null; + this.filters = this.parse_filters_from_route_options(); } else if (this.view_user_settings.filters) { // Priority 2: saved filters const saved_filters = this.view_user_settings.filters; @@ -1126,11 +1115,17 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { return actions_menu_items; } - set_filters_from_route_options() { + parse_filters_from_route_options() { const filters = []; + for (let field in frappe.route_options) { - var value = frappe.route_options[field]; - var doctype = null; + + let doctype = null; + let value = frappe.route_options[field]; + + if (value.startsWith('[') && value.endsWith(']')) { + value = JSON.parse(value); + } // if `Child DocType.fieldname` if (field.includes('.')) { @@ -1157,10 +1152,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { } frappe.route_options = null; - this.filter_area.clear(false) - .then(() => { - this.filter_area.add(filters); - }); + return filters; } static trigger_list_update(data) { diff --git a/package.json b/package.json index 8737f9baef..858af45d88 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "awesomplete": "^1.1.2", "cookie": "^0.3.1", "express": "^4.16.2", - "frappe-datatable": "^1.5.0", + "frappe-datatable": "^1.5.3", "frappe-gantt": "^0.1.0", "fuse.js": "^3.2.0", "highlight.js": "^9.12.0", diff --git a/yarn.lock b/yarn.lock index b95ec470b8..fa24a2e6e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1224,10 +1224,10 @@ forwarded@~0.1.2: resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= -frappe-datatable@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.5.0.tgz#eea78a87e799876b71e58dbdc128fd9badb5e2c6" - integrity sha512-h9yP33UqRcEfcs5FVSFFUigya/KT5qFrB1vOqayhxqPoxdVH2pGKi+Qh/BO5KRNd6uVk8rVwXMhA8A9TU+2uEg== +frappe-datatable@^1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.5.3.tgz#f60e619a92b77b60cdbb8376e521398a2933995a" + integrity sha512-1sEcnOUxN+vI5BgrPJPNJNc72kAX4RQRNBJjR2RWVotczIE+YJZ4e8M1k6d4xXFWOj687qD9wha7uveSKy2jkQ== dependencies: hyperlist "^1.0.0-beta" lodash "^4.17.5"