diff --git a/frappe/desk/doctype/notification_settings/notification_settings.json b/frappe/desk/doctype/notification_settings/notification_settings.json index 68eec92125..c2f3633d63 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.json +++ b/frappe/desk/doctype/notification_settings/notification_settings.json @@ -72,15 +72,14 @@ "fieldname": "user", "fieldtype": "Link", "hidden": 1, - "in_list_view": 1, "label": "User", "options": "User", "read_only": 1 } ], "in_create": 1, - "modified": "2019-10-23 12:42:56.175928", - "modified_by": "Administrator", + "modified": "2019-11-08 14:11:35.619306", + "modified_by": "frappetestuser2@gmail.com", "module": "Desk", "name": "Notification Settings", "owner": "Administrator", @@ -97,7 +96,6 @@ "write": 1 } ], - "read_only": 1, "sort_field": "modified", "sort_order": "DESC", "track_changes": 1 diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index bce8e58fdf..3ccbc3318c 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -1,3 +1,5 @@ +frappe.provide('frappe.search'); + frappe.ui.Notifications = class Notifications { constructor() { frappe.model @@ -29,10 +31,30 @@ frappe.ui.Notifications = class Notifications { ); frappe.utils.bind_actions_with_object(this.$dropdown_list, this); + let me = this; + frappe.search.utils.make_function_searchable( + me.route_to_settings, + __('Notification Settings'), + [this.notifications_settings], + ) + this.setup_notifications(); this.bind_events(); } + route_to_settings(settings_doc) { + let method = + 'frappe.desk.doctype.notification_settings.notification_settings.create_notification_settings'; + + return Promise.resolve() + .then(() => { + if (!settings_doc) return frappe.call(method); + }) + .then(() => { + frappe.set_route(`#Form/Notification Settings/${frappe.session.user}`); + }); + } + setup_notifications() { this.get_notifications_list(this.max_length).then(list => { this.dropdown_items = list; @@ -249,7 +271,7 @@ frappe.ui.Notifications = class Notifications { } ); } - + mark_all_as_seen() { this.$dropdown_list.find('.unseen').removeClass('unseen'); let unseen_docnames = this.dropdown_items @@ -368,7 +390,7 @@ frappe.ui.Notifications = class Notifications { let mark_all_read_html = category.value === 'Notifications' ? ` - ${__('Mark All as Read')} + ${__('Mark all as Read')} ` : ''; let html = `