From 7dad19f8be957bfb3663ad145867fa0a611ca177 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 19 Jun 2024 18:28:49 +0300 Subject: [PATCH] RED-9370: fixed notification links not working. --- .../notifications/notifications.component.html | 7 +++---- .../components/notifications/notifications.component.ts | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/components/notifications/notifications.component.html b/apps/red-ui/src/app/components/notifications/notifications.component.html index 5f2b7e66b..0d0652faf 100644 --- a/apps/red-ui/src/app/components/notifications/notifications.component.html +++ b/apps/red-ui/src/app/components/notifications/notifications.component.html @@ -32,19 +32,18 @@
-
{{ notification.creationDate | date : 'exactDate' }}
+
{{ notification.creationDate | date: 'exactDate' }}
diff --git a/apps/red-ui/src/app/components/notifications/notifications.component.ts b/apps/red-ui/src/app/components/notifications/notifications.component.ts index 743dcda00..70992bb6f 100644 --- a/apps/red-ui/src/app/components/notifications/notifications.component.ts +++ b/apps/red-ui/src/app/components/notifications/notifications.component.ts @@ -58,6 +58,15 @@ export class NotificationsComponent { await this._notificationsService.toggleNotificationRead(notificationsIds, isRead); } + async handleMarkReadEvent(event: MouseEvent, notifications: Notification[] = this._notificationsService.all, isRead = true) { + if (!(event.target as HTMLBaseElement).href) { + event.stopPropagation(); + event.preventDefault(); + } + + await this.markRead(notifications, isRead); + } + #groupNotifications(notifications: Notification[]): NotificationsGroup[] { const todayTranslation = this._translateService.instant('today'); const groupedMap = notifications.groupBy(n => {