diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html index 4e47d48348..cf27080210 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html @@ -100,6 +100,23 @@ {{ 'notification.create-new' | translate }} +
+ + {{ 'notification.scheduler-later' | translate }} + +
+ + + + notification.time + + + + +
+
+ {{ 'notification.review' | translate }}
-
+
-
Web notification preview
+
notification.delivery-method-type.push-preview
+
+
+ +
notification.delivery-method-type.email-preview
+
+
+
{{ preview.processedTemplates.EMAIL.subject }}
+ +
+
+
+
+
+ +
notification.delivery-method-type.sms-preview
+
+
+ {{ preview.processedTemplates.SMS.body }} +
+
+
+
+ +
notification.delivery-method-type.slack-preview
+
+
+ {{ preview.processedTemplates.SLACK.body }} +
+
supervisor_account @@ -248,23 +294,6 @@
-
- - {{ 'notification.scheduler-later' | translate }} - -
- - - - notification.time - - - - -
-
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss index b79ee17201..881287067e 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss @@ -114,6 +114,26 @@ background-color: #fff; } } + + .notification-content { + border: 1px solid rgba(0, 0, 0, 0.12); + border-radius: 4px; + background: #fff; + padding: 12px 16px; + + .subject { + padding-bottom: 12px; + font-weight: 500; + letter-spacing: 0.25px; + } + + .html-content { + margin-top: 12px; + font-weight: 400; + font-size: 14px; + line-height: 20px; + } + } } @media #{$mat-gt-xs} { @@ -240,4 +260,13 @@ } } } + + .preview-group { + .notification-content { + .html-content, + .html-content * { + all: revert; + } + } + } } diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts index a2c9c5dafd..fafa54157c 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts +++ b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts @@ -65,7 +65,6 @@ export class RequestNotificationDialogComponent extends notificationType = NotificationType; notificationRequestForm: FormGroup; - notificationRequestAdditionalConfigForm: FormGroup; notificationDeliveryMethods = Object.keys(NotificationDeliveryMethod) as NotificationDeliveryMethod[]; notificationDeliveryMethodTranslateMap = NotificationDeliveryMethodTranslateMap; @@ -92,7 +91,12 @@ export class RequestNotificationDialogComponent extends useTemplate: [true], templateId: [null, Validators.required], targets: [null, Validators.required], - template: this.templateNotificationForm + template: this.templateNotificationForm, + additionalConfig: this.fb.group({ + enabled: [false], + timezone: [{value: '', disabled: true}, Validators.required], + time: [{value: 0, disabled: true}, Validators.required] + }) }); this.notificationRequestForm.get('template').disable({emitEvent: false}); @@ -111,21 +115,15 @@ export class RequestNotificationDialogComponent extends } }); - this.notificationRequestAdditionalConfigForm = this.fb.group({ - enabled: [false], - timezone: [{value: '', disabled: true}, Validators.required], - time: [{value: 0, disabled: true}, Validators.required] - }); - - this.notificationRequestAdditionalConfigForm.get('enabled').valueChanges.pipe( + this.notificationRequestForm.get('additionalConfig.enabled').valueChanges.pipe( takeUntil(this.destroy$) ).subscribe(value => { if (value) { - this.notificationRequestAdditionalConfigForm.get('timezone').enable({emitEvent: false}); - this.notificationRequestAdditionalConfigForm.get('time').enable({emitEvent: false}); + this.notificationRequestForm.get('additionalConfig.timezone').enable({emitEvent: false}); + this.notificationRequestForm.get('additionalConfig.time').enable({emitEvent: false}); } else { - this.notificationRequestAdditionalConfigForm.get('timezone').disable({emitEvent: false}); - this.notificationRequestAdditionalConfigForm.get('time').disable({emitEvent: false}); + this.notificationRequestForm.get('additionalConfig.timezone').disable({emitEvent: false}); + this.notificationRequestForm.get('additionalConfig.time').disable({emitEvent: false}); } }); @@ -208,8 +206,8 @@ export class RequestNotificationDialogComponent extends delete formValue.useTemplate; delete formValue.template; let delay = 0; - if (this.notificationRequestAdditionalConfigForm.value.enabled) { - delay = (this.notificationRequestAdditionalConfigForm.value.time.valueOf() - this.minDate().valueOf()) / 1000; + if (formValue.additionalConfig.enabled) { + delay = (this.notificationRequestForm.value.additionalConfig.time.valueOf() - this.minDate().valueOf()) / 1000; } formValue.additionalConfig = { sendingDelayInSec: delay > 0 ? delay : 0 @@ -230,7 +228,7 @@ export class RequestNotificationDialogComponent extends } minDate(): Date { - return new Date(getCurrentTime(this.notificationRequestAdditionalConfigForm.get('timezone').value).format('lll')); + return new Date(getCurrentTime(this.notificationRequestForm.get('additionalConfig.timezone').value).format('lll')); } maxDate(): Date { 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 fbb6429b05..3f5f7e40bb 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 @@ -207,10 +207,6 @@ - diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss index fd9ec86157..adb451b170 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss @@ -17,7 +17,7 @@ @import "../../../../../../theme"; :host-context(.tb-fullscreen-dialog .mat-dialog-container) { - width: 720px; + width: 830px; max-height: 100vh; .tb-form-fields { diff --git a/ui-ngx/src/app/modules/home/pages/profile/profile.component.html b/ui-ngx/src/app/modules/home/pages/profile/profile.component.html index bcde7b8c40..03c83968df 100644 --- a/ui-ngx/src/app/modules/home/pages/profile/profile.component.html +++ b/ui-ngx/src/app/modules/home/pages/profile/profile.component.html @@ -57,7 +57,7 @@ diff --git a/ui-ngx/src/app/modules/home/pages/user/user.component.html b/ui-ngx/src/app/modules/home/pages/user/user.component.html index 8e187997a8..49813824bf 100644 --- a/ui-ngx/src/app/modules/home/pages/user/user.component.html +++ b/ui-ngx/src/app/modules/home/pages/user/user.component.html @@ -93,7 +93,7 @@ diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 8c59f98620..14c1c3d57a 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -2726,9 +2726,13 @@ "delivery-method": "Delivery method", "delivery-method-type": { "email": "Email", + "email-preview": "Email notification preview", "push": "Web", + "push-preview": "Web notification preview", "slack": "Slack", - "sms": "SMS" + "slack-preview": "Slack notification preview", + "sms": "SMS", + "sms-preview": "SMS notification preview" }, "delivery-methods": "Delivery methods", "description": "Description", @@ -2794,7 +2798,6 @@ "search-targets": "Search recipients", "search-templates": "Search templates", "send-notification": "Send notification", - "send-test-notification": "Send test notification", "sent": "Sent", "settings": "Notification settings", "slack": "Slack",