mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-4529] Refactor Notification History Component (#6620)
* [AAE-4529] Refactor Notification History Component * Improve code * Add maxNotifications * More changes * Add documentation * Rebase branch * Fix build * Update notification-history.component.md * Fix e2e tests Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
@@ -19,18 +19,22 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationModel, NOTIFICATION_TYPE } from '../models/notification.model';
|
||||
|
||||
@Pipe({
|
||||
name: 'noticicationIcon'
|
||||
name: 'notificationIcon'
|
||||
})
|
||||
export class NotificationIconPipe implements PipeTransform {
|
||||
|
||||
transform(notification: NotificationModel): string {
|
||||
switch (notification.type) {
|
||||
case NOTIFICATION_TYPE.ERROR:
|
||||
return 'error';
|
||||
case NOTIFICATION_TYPE.WARN:
|
||||
return 'warning';
|
||||
default:
|
||||
return 'info';
|
||||
if (notification.icon) {
|
||||
return notification.icon;
|
||||
} else {
|
||||
switch (notification.type) {
|
||||
case NOTIFICATION_TYPE.ERROR:
|
||||
return 'error';
|
||||
case NOTIFICATION_TYPE.WARN:
|
||||
return 'warning';
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user