From b1a6264fd1096134cd57de1573835fb92298049f Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 7 Feb 2023 17:31:01 +0200 Subject: [PATCH] UI: Improvement notification web view --- .../notification-bell.component.ts | 2 +- .../show-notification-popover.component.html | 3 +- ...emplate-notification-dialog.component.html | 18 ++++++------ .../notification/notification.component.html | 17 +++++------ .../notification/notification.component.scss | 16 +++++------ .../notification/notification.component.ts | 28 +++++++++---------- 6 files changed, 41 insertions(+), 43 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts b/ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts index 41566ed03f..94b0ecd7e4 100644 --- a/ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts +++ b/ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts @@ -78,7 +78,7 @@ export class NotificationBellComponent implements OnInit { showNotificationPopover.hide(); } }, - {maxHeight: '100vh', height: '100%', padding: '10px'}, + {maxHeight: '90vh', height: '100%', padding: '10px'}, {width: '400px', minWidth: '100%', maxWidth: '100%'}, {height: '100%', flexDirection: 'column', boxSizing: 'border-box', display: 'flex'}, false); showNotificationPopover.tbComponentRef.instance.popoverComponent = showNotificationPopover; diff --git a/ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.html b/ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.html index a82c425f6a..abd8682b56 100644 --- a/ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.html +++ b/ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.html @@ -29,14 +29,13 @@
-
+
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html index abdef1ef0c..0810138e59 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html @@ -43,15 +43,15 @@ {{ 'notification.target-name-required' | translate }} - - - -
-
{{ notificationTemplateTypeTranslateMap.get(notificationType).name | translate }}
-
{{ notificationTemplateTypeTranslateMap.get(notificationType).hint | translate }}
-
-
-
+ + notification.type + + + {{ notificationTemplateTypeTranslateMap.get(notificationType).name | translate }} + + + {{ notificationTemplateTypeTranslateMap.get(templateNotificationForm.get('notificationType').value).hint | translate }} +
notification.subject diff --git a/ui-ngx/src/app/shared/components/notification/notification.component.html b/ui-ngx/src/app/shared/components/notification/notification.component.html index 67f153ff05..5720c5ce04 100644 --- a/ui-ngx/src/app/shared/components/notification/notification.component.html +++ b/ui-ngx/src/app/shared/components/notification/notification.component.html @@ -23,7 +23,7 @@ - + {{ notificationTypeIcons.get(notification.type) }} @@ -37,14 +37,15 @@
- - {{ notification.createdTime | dateAgo }} -
+ {{ notification.createdTime | dateAgo }} + +
+
- + {{alarmSeverityTranslations.get(notification.info.alarmSeverity) | translate}}
diff --git a/ui-ngx/src/app/shared/components/notification/notification.component.scss b/ui-ngx/src/app/shared/components/notification/notification.component.scss index 367a768eb9..5a660b0df5 100644 --- a/ui-ngx/src/app/shared/components/notification/notification.component.scss +++ b/ui-ngx/src/app/shared/components/notification/notification.component.scss @@ -19,12 +19,7 @@ padding: 10px; display: block; border: 1px solid; - border-radius: 8px; - } - - .alarm-severity-border { - padding: 5px; - border-radius: 8px; + border-radius: 4px; } .icon { @@ -45,7 +40,7 @@ } .button { - margin-top: 8px; + margin-top: 12px; border-color: initial; } } @@ -62,7 +57,12 @@ .time { font-size: 12px; letter-spacing: 0.25px; - margin: 2px 2px 5px; + margin: 0 4px; + } + + .alarm-severity { + padding: 5px; + border-radius: 8px; } } } diff --git a/ui-ngx/src/app/shared/components/notification/notification.component.ts b/ui-ngx/src/app/shared/components/notification/notification.component.ts index ab2f03edc1..0eb7c74513 100644 --- a/ui-ngx/src/app/shared/components/notification/notification.component.ts +++ b/ui-ngx/src/app/shared/components/notification/notification.component.ts @@ -15,16 +15,11 @@ /// import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { - Notification, - NotificationType, - NotificationTypeColors, - NotificationTypeIcons -} from '@shared/models/notification.models'; +import { Notification, NotificationType, NotificationTypeIcons } from '@shared/models/notification.models'; import { UtilsService } from '@core/services/utils.service'; import { Router } from '@angular/router'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; -import { AlarmSeverity, alarmSeverityColors, alarmSeverityTranslations } from '@shared/models/alarm.models'; +import { alarmSeverityColors, alarmSeverityTranslations } from '@shared/models/alarm.models'; import * as tinycolor_ from 'tinycolor2'; @Component({ @@ -59,10 +54,7 @@ export class NotificationComponent implements OnInit { tinycolor = tinycolor_; notificationType = NotificationType; - notificationTypeColors = NotificationTypeColors; notificationTypeIcons = NotificationTypeIcons; - alarmSeverity = AlarmSeverity; - alarmSeverityColors = alarmSeverityColors; alarmSeverityTranslations = alarmSeverityTranslations; constructor( @@ -103,14 +95,20 @@ export class NotificationComponent implements OnInit { } alarmColorSeverity(alpha: number) { - return this.tinycolor(this.alarmSeverityColors.get(this.notification.info.alarmSeverity)).setAlpha(alpha).toRgbString(); + return this.tinycolor(alarmSeverityColors.get(this.notification.info.alarmSeverity)).setAlpha(alpha).toRgbString(); } - notificationColor() { + notificationColor(): string { if (this.notification.type === this.notificationType.ALARM) { - return this.alarmSeverityColors.get(this.notification.info.alarmSeverity); - } else { - return this.notificationTypeColors.get(this.notification.type); + return alarmSeverityColors.get(this.notification.info.alarmSeverity); } + return 'transparent'; + } + + notificationIconColor(): object { + if (this.notification.type === this.notificationType.ALARM) { + return {color: alarmSeverityColors.get(this.notification.info.alarmSeverity)}; + } + return null; } }