parent
b66932b413
commit
024680c0e6
@ -0,0 +1,10 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({ name: 'sumarizeText' })
|
||||
export class SumarizeTextPipe implements PipeTransform {
|
||||
transform(items: any[], limit: number) {
|
||||
if (items.length > limit) {
|
||||
return `${items.slice(0, limit-3)}...`;
|
||||
} else { return items; }
|
||||
}
|
||||
}
|
@ -1,19 +1,29 @@
|
||||
<div class="dropdown-top"></div>
|
||||
|
||||
<mat-nav-list class="inapp-notification-listing-dialog">
|
||||
<a *ngFor="let inappNotification of inappNotifications; last as last;" mat-list-item (click)="goToNotification(inappNotification)">
|
||||
<mat-icon *ngIf="inappNotification.trackingState === notificationInAppTrackingEnum.Delivered" mat-list-icon>drafts</mat-icon>
|
||||
<mat-icon *ngIf="inappNotification.trackingState === notificationInAppTrackingEnum.Stored" mat-list-icon>mail</mat-icon>
|
||||
<span mat-line>{{ inappNotification.subject }}</span>
|
||||
<span mat-line class="secondary-text">{{ inappNotification.createdAt | date : 'short'}}</span>
|
||||
<mat-divider inset *ngIf="!last"></mat-divider>
|
||||
</a>
|
||||
<mat-list-item class = "mat-list-item-content" *ngIf="authService.hasPermission(authService.permissionEnum.ViewMineInAppNotificationPage)">
|
||||
<a (click)="goToNotifications()">{{'NAV-BAR.INAPP-NOTIFICATIONS'
|
||||
| translate}}</a>
|
||||
</mat-list-item>
|
||||
<mat-list-item class = "mat-list-item-content" *ngIf="authService.hasPermission(authService.permissionEnum.ViewMineInAppNotificationPage)">
|
||||
<a (click)="readAllNotifications()">{{'NAV-BAR.READ-ALL-INAPP-NOTIFICATIONS'
|
||||
| translate}}</a>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
<div class="notification-popup-wrapper">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<mat-nav-list class="inapp-notification-listing-dialog">
|
||||
<a *ngFor="let inappNotification of inappNotifications; last as last;" mat-list-item (click)="goToNotification(inappNotification)">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex">
|
||||
<mat-icon *ngIf="inappNotification.trackingState === notificationInAppTrackingEnum.Delivered" mat-list-icon class="mr-3">drafts</mat-icon>
|
||||
<mat-icon *ngIf="inappNotification.trackingState === notificationInAppTrackingEnum.Stored" mat-list-icon class="mr-3">mail</mat-icon>
|
||||
<span mat-line>{{ inappNotification.subject | sumarizeText:21 }}</span>
|
||||
</div>
|
||||
|
||||
<span mat-line class="secondary-text">{{ inappNotification.createdAt | date : 'short'}}</span>
|
||||
<mat-divider inset *ngIf="!last"></mat-divider>
|
||||
</div>
|
||||
</a>
|
||||
<mat-list-item *ngIf="authService.hasPermission(authService.permissionEnum.ViewMineInAppNotificationPage)">
|
||||
<a (click)="goToNotifications()">{{'NAV-BAR.INAPP-NOTIFICATIONS'
|
||||
| translate}}</a>
|
||||
</mat-list-item>
|
||||
<mat-list-item *ngIf="authService.hasPermission(authService.permissionEnum.ViewMineInAppNotificationPage)">
|
||||
<a (click)="readAllNotifications()">{{'NAV-BAR.READ-ALL-INAPP-NOTIFICATIONS'
|
||||
| translate}}</a>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue