Merge branch 'RED-9370' into 'master'
RED-9370: fixed notification links not working. See merge request redactmanager/red-ui!463
This commit is contained in:
commit
b0ab6bd302
@ -32,19 +32,18 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
(click)="markRead([notification], true)"
|
||||
(click)="handleMarkReadEvent($event, [notification], true)"
|
||||
*ngFor="let notification of group.notifications; trackBy: trackBy"
|
||||
[class.unread]="!notification.readDate"
|
||||
[id]="'notifications-mark-as-read-' + notification.id + '-btn'"
|
||||
class="notification"
|
||||
iqserStopPropagation
|
||||
mat-menu-item
|
||||
>
|
||||
<iqser-initials-avatar [user]="notification.userId"></iqser-initials-avatar>
|
||||
|
||||
<div class="notification-content">
|
||||
<div [innerHTML]="notification.message"></div>
|
||||
<div class="small-label mt-2">{{ notification.creationDate | date : 'exactDate' }}</div>
|
||||
<div class="small-label mt-2">{{ notification.creationDate | date: 'exactDate' }}</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@ -52,7 +51,7 @@
|
||||
[id]="'notifications-mark-' + notification.id"
|
||||
class="dot"
|
||||
iqserStopPropagation
|
||||
matTooltip="{{ 'notifications.mark-as' | translate : { type: notification.readDate ? 'unread' : 'read' } }}"
|
||||
matTooltip="{{ 'notifications.mark-as' | translate: { type: notification.readDate ? 'unread' : 'read' } }}"
|
||||
matTooltipPosition="before"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@ -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 => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user