From 2b32dc054c721f27447091e63ce769cecf8d0acf Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 24 Feb 2023 12:20:22 +0530 Subject: [PATCH] chore: rename "field" -> "notification_log" field makes no sense here. --- .../frappe/ui/notifications/notifications.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index dab436acc7..a0c0257f1d 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -237,18 +237,18 @@ class NotificationsView extends BaseNotificationsView { this.change_activity_status(); } - get_dropdown_item_html(field) { - let doc_link = this.get_item_link(field); + get_dropdown_item_html(notification_log) { + let doc_link = this.get_item_link(notification_log); - let read_class = field.read ? "" : "unread"; - let message = field.subject; + let read_class = notification_log.read ? "" : "unread"; + let message = notification_log.subject; let title = message.match(/(.*?)<\/b>/); message = title ? message.replace(title[1], frappe.ellipsis(strip_html(title[1]), 100)) : message; - let timestamp = frappe.datetime.comment_when(field.creation); + let timestamp = frappe.datetime.comment_when(notification_log.creation); let message_html = `
${message}
@@ -256,12 +256,12 @@ class NotificationsView extends BaseNotificationsView {
`; - let user = field.from_user; + let user = notification_log.from_user; let user_avatar = frappe.avatar(user, "avatar-medium user-avatar"); let item_html = $(`
${user_avatar} @@ -271,18 +271,18 @@ class NotificationsView extends BaseNotificationsView {
`); - if (!field.read) { + if (!notification_log.read) { let mark_btn = item_html.find(".mark-as-read"); mark_btn.tooltip({ delay: { show: 600, hide: 100 }, trigger: "hover" }); mark_btn.on("click", (e) => { e.preventDefault(); e.stopImmediatePropagation(); - this.mark_as_read(field.name, item_html); + this.mark_as_read(notification_log.name, item_html); }); } item_html.on("click", () => { - !field.read && this.mark_as_read(field.name, item_html); + !notification_log.read && this.mark_as_read(notification_log.name, item_html); this.notifications_icon.trigger("click"); }); @@ -298,8 +298,8 @@ class NotificationsView extends BaseNotificationsView { } else { if (this.dropdown_items.length) { this.container.empty(); - this.dropdown_items.forEach((field) => { - this.container.append(this.get_dropdown_item_html(field)); + this.dropdown_items.forEach((notification_log) => { + this.container.append(this.get_dropdown_item_html(notification_log)); }); this.container.append(`