From 58fe724428f3020949a90edefd667f3fae5354db Mon Sep 17 00:00:00 2001 From: prssanna Date: Wed, 8 Apr 2020 14:24:44 +0530 Subject: [PATCH 1/8] refactor: allow system managers to view notification settings list for all users --- .../notification_settings/notification_settings.js | 9 +++++++++ .../notification_settings/notification_settings.py | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frappe/desk/doctype/notification_settings/notification_settings.js b/frappe/desk/doctype/notification_settings/notification_settings.js index d4e3b08def..863840d155 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.js +++ b/frappe/desk/doctype/notification_settings/notification_settings.js @@ -8,5 +8,14 @@ frappe.ui.form.on('Notification Settings', { route: '#modules/Settings', type: 'Custom' }); + }, + + refresh: (frm) => { + if (frappe.user.has_role(['System Manager', 'Administrator'])) { + frm.add_custom_button('Go to Notification Settings List', () => { + frappe.set_route('List', 'Notification Settings'); + }); + } } + }); diff --git a/frappe/desk/doctype/notification_settings/notification_settings.py b/frappe/desk/doctype/notification_settings/notification_settings.py index 233d15e3ce..6b5a13ee27 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.py +++ b/frappe/desk/doctype/notification_settings/notification_settings.py @@ -62,7 +62,14 @@ def get_subscribed_documents(): def get_permission_query_conditions(user): if not user: user = frappe.session.user - return '''(`tabNotification Settings`.user = '{user}')'''.format(user=user) + if user == 'Administrator': + return + + roles = frappe.get_roles(user) + if "System Manager" in roles: + return '''(`tabNotification Settings`.name != 'Administrator')''' + + return '''(`tabNotification Settings`.name = '{user}')'''.format(user=user) @frappe.whitelist() def set_seen_value(value, user): From 3713a53a96e073fa0c28c6eace10e41d7b026f62 Mon Sep 17 00:00:00 2001 From: prssanna Date: Wed, 8 Apr 2020 18:55:51 +0530 Subject: [PATCH 2/8] fix: allow dashboard chart type to be set only once --- frappe/desk/doctype/dashboard_chart/dashboard_chart.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json index 9652ae3945..676cdbe24a 100644 --- a/frappe/desk/doctype/dashboard_chart/dashboard_chart.json +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.json @@ -49,7 +49,8 @@ "fieldname": "chart_type", "fieldtype": "Select", "label": "Chart Type", - "options": "Count\nSum\nAverage\nGroup By\nCustom\nReport" + "options": "Count\nSum\nAverage\nGroup By\nCustom\nReport", + "set_only_once": 1 }, { "depends_on": "eval:doc.chart_type === 'Custom'", @@ -215,7 +216,7 @@ } ], "links": [], - "modified": "2020-03-31 16:00:01.987059", + "modified": "2020-04-08 18:54:36.739183", "modified_by": "Administrator", "module": "Desk", "name": "Dashboard Chart", From 1fc2f0d27caa5570f7a8751c7ab607a8c626673d Mon Sep 17 00:00:00 2001 From: Prssanna Desai Date: Thu, 9 Apr 2020 09:31:36 +0530 Subject: [PATCH 3/8] fix: bread word if too long in link preview popover (#9869) --- frappe/public/less/link_preview.less | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/public/less/link_preview.less b/frappe/public/less/link_preview.less index 5bc9767815..22a61a79e7 100644 --- a/frappe/public/less/link_preview.less +++ b/frappe/public/less/link_preview.less @@ -37,6 +37,7 @@ padding-bottom: 5px; max-width: 330px; min-width: 200px; + overflow-wrap: break-word; .preview-field { padding-bottom: 10px; From 029b8f0a35af32c220dd411a6efc90c94c1dc1cf Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 9 Apr 2020 09:40:42 +0530 Subject: [PATCH 4/8] fix: Remove Admin role from check --- .../desk/doctype/notification_settings/notification_settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/desk/doctype/notification_settings/notification_settings.js b/frappe/desk/doctype/notification_settings/notification_settings.js index 863840d155..fc8be15965 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.js +++ b/frappe/desk/doctype/notification_settings/notification_settings.js @@ -11,7 +11,7 @@ frappe.ui.form.on('Notification Settings', { }, refresh: (frm) => { - if (frappe.user.has_role(['System Manager', 'Administrator'])) { + if (frappe.user.has_role('System Manager')) { frm.add_custom_button('Go to Notification Settings List', () => { frappe.set_route('List', 'Notification Settings'); }); From ab383b5bee68784822bdb2613ef8ecee0034a393 Mon Sep 17 00:00:00 2001 From: prssanna Date: Thu, 9 Apr 2020 10:59:27 +0530 Subject: [PATCH 5/8] style: fix indent --- .../desk/doctype/notification_settings/notification_settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/desk/doctype/notification_settings/notification_settings.js b/frappe/desk/doctype/notification_settings/notification_settings.js index fc8be15965..b8b7f37a4f 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.js +++ b/frappe/desk/doctype/notification_settings/notification_settings.js @@ -13,7 +13,7 @@ frappe.ui.form.on('Notification Settings', { refresh: (frm) => { if (frappe.user.has_role('System Manager')) { frm.add_custom_button('Go to Notification Settings List', () => { - frappe.set_route('List', 'Notification Settings'); + frappe.set_route('List', 'Notification Settings'); }); } } From bb87ce2b118f92316db90330bb115ba62f111b41 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 9 Apr 2020 11:10:33 +0530 Subject: [PATCH 6/8] chore(CODEOWNERS): Remove comma --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 2ff8752871..2c8891ce86 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,7 +3,7 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -* @surajshetty3416, @netchampfaris +* @surajshetty3416 @netchampfaris website/ @scmmishra templates/ @scmmishra www/ @scmmishra @@ -14,4 +14,4 @@ email/ @Thunderbottom event_streaming/ @ruchamahabal data_import* @netchampfaris core/ @surajshetty3416 -requirements.txt @gavindsouza \ No newline at end of file +requirements.txt @gavindsouza From 953d0f273eb70578d61f7d1f6221d83de3d9f29a Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 9 Apr 2020 11:45:03 +0530 Subject: [PATCH 7/8] chore(CODEOWNERS): Update owners --- CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 2c8891ce86..e27856b8ae 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,8 +3,9 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -* @surajshetty3416 @netchampfaris +* @surajshetty3416 website/ @scmmishra +web_form/ @scmmishra templates/ @scmmishra www/ @scmmishra integrations/ @Mangesh-Khairnar From e06114ea54a86230162448705fa10ee0293fccb6 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 9 Apr 2020 13:23:33 +0530 Subject: [PATCH 8/8] chore(CODEOWNERS): Add frappe-review-team as fallback owner --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index e27856b8ae..8e6f8eb5e9 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,13 +3,13 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -* @surajshetty3416 +* @frappe/frappe-review-team website/ @scmmishra web_form/ @scmmishra templates/ @scmmishra www/ @scmmishra integrations/ @Mangesh-Khairnar -patches/ @surajshetty3416 @sahil28297 +patches/ @sahil28297 dashboard/ @prssanna email/ @Thunderbottom event_streaming/ @ruchamahabal