From fac385c7c259584cdfaa972bdf4edf0234cfde9c Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Fri, 22 Nov 2024 11:50:42 +0100 Subject: [PATCH 1/6] Add calendar reminders to notification panel --- www/notifications/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/notifications/inner.js b/www/notifications/inner.js index 874a88b15..0e956c182 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -143,7 +143,7 @@ define([ $(loadmore).click(); } - common.mailbox.subscribe(["notifications"], { + common.mailbox.subscribe(["notifications", "reminders"], { onMessage: function (data, el) { addNotification(data, el); }, From 406f5d6e22046ed610fdac829ee15220ff7de866 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Fri, 22 Nov 2024 15:54:36 +0100 Subject: [PATCH 2/6] Fixed layout of reminder icon --- www/notifications/inner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/notifications/inner.js b/www/notifications/inner.js index 0e956c182..fc3206ee6 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -145,6 +145,7 @@ define([ common.mailbox.subscribe(["notifications", "reminders"], { onMessage: function (data, el) { + el.innerHTML = el.innerHTML.replace('') addNotification(data, el); }, onViewed: function (data) { From 63e3fbd7d45c4644527e194ae396d447d6a02648 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Fri, 22 Nov 2024 15:57:39 +0100 Subject: [PATCH 3/6] Linting --- www/notifications/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/notifications/inner.js b/www/notifications/inner.js index fc3206ee6..d927f7de9 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -145,7 +145,7 @@ define([ common.mailbox.subscribe(["notifications", "reminders"], { onMessage: function (data, el) { - el.innerHTML = el.innerHTML.replace('') + el.innerHTML = el.innerHTML.replace(''); addNotification(data, el); }, onViewed: function (data) { From c0f9c54d8caa87610231ffe8fafe8eb60923dc57 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Wed, 4 Dec 2024 21:31:54 +0100 Subject: [PATCH 4/6] DOM manipulation --- www/notifications/inner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/notifications/inner.js b/www/notifications/inner.js index d927f7de9..ca93f5d17 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -86,6 +86,8 @@ define([ var addNotification = function (data, el) { // if the type of notification correspond if (filterTypes.indexOf(data.content.msg.type) !== -1) { + var icon = $(".cp-reminder"); + $(icon).wrap('').wrap('') notifsData.push(data); $(notifsList).prepend(el); } @@ -145,7 +147,6 @@ define([ common.mailbox.subscribe(["notifications", "reminders"], { onMessage: function (data, el) { - el.innerHTML = el.innerHTML.replace(''); addNotification(data, el); }, onViewed: function (data) { From 23c82d4e4fae679b20e42b13ece30daeaaedb432 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Thu, 5 Dec 2024 08:51:45 +0100 Subject: [PATCH 5/6] Added reminder icon .less style --- www/notifications/app-notifications.less | 9 ++++++--- www/notifications/inner.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/www/notifications/app-notifications.less b/www/notifications/app-notifications.less index 8bf0eccbe..b3dcf439c 100644 --- a/www/notifications/app-notifications.less +++ b/www/notifications/app-notifications.less @@ -78,6 +78,7 @@ justify-content: flex-start; align-items: center; background-color: @cp_notif-bg; + border-top: 1px solid @cp_notif-table-border; &.no-notifications { display: none; padding: 1rem 1rem; @@ -95,12 +96,14 @@ background-color: @cp_notif-hover; } } + .cp-avatar-calendar { + font-size: 45px; + padding: 0 12px; + overflow: hidden; + } &.cp-app-notification-archived { background-color: @cp_notif-bg; } - &:not(:first-child) { - border-top: 1px solid @cp_notif-table-border; - } &.dismissed { display: none; } diff --git a/www/notifications/inner.js b/www/notifications/inner.js index ca93f5d17..8489e3809 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -86,9 +86,9 @@ define([ var addNotification = function (data, el) { // if the type of notification correspond if (filterTypes.indexOf(data.content.msg.type) !== -1) { - var icon = $(".cp-reminder"); - $(icon).wrap('').wrap('') notifsData.push(data); + var icon = $(el).find(".cp-reminder"); + $(icon).addClass('cp-avatar-calendar') $(notifsList).prepend(el); } }; From 6f72a14cfc2aec676c57e069f77d615055334063 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Thu, 5 Dec 2024 09:57:42 +0100 Subject: [PATCH 6/6] Linting --- www/notifications/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/notifications/inner.js b/www/notifications/inner.js index 8489e3809..7abcbac79 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -88,7 +88,7 @@ define([ if (filterTypes.indexOf(data.content.msg.type) !== -1) { notifsData.push(data); var icon = $(el).find(".cp-reminder"); - $(icon).addClass('cp-avatar-calendar') + $(icon).addClass('cp-avatar-calendar'); $(notifsList).prepend(el); } };