diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts index e3ee10bbc4..744245ca19 100644 --- a/ui-ngx/src/app/core/http/entity.service.ts +++ b/ui-ngx/src/app/core/http/entity.service.ts @@ -251,6 +251,9 @@ export class EntityService { (id) => this.widgetService.getWidgetsBundle(id, config), entityIds); break; + case EntityType.NOTIFICATION_TARGET: + observable = of([]); + break; } return observable; } diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts index eb27a05426..23fa0ec3e0 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts +++ b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts @@ -81,7 +81,12 @@ export class RequestTableConfig extends EntityTableConfig> { - return []; + return [{ + name: this.translate.instant('notification.notify-again'), + mdiIcon: 'mdi:repeat-variant', + isEnabled: (request) => request.status !== NotificationRequestStatus.SCHEDULED, + onAction: ($event, entity) => this.createRequest($event, entity) + }]; } private createRequest($event: Event, request: NotificationRequest, isAdd = false, updateData = true) { diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/template-table-config.ts b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/template-table-config.ts index 4fb089f826..daa7cc0b93 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/template-table-config.ts +++ b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/template-table-config.ts @@ -21,7 +21,7 @@ import { } from '@home/models/entity/entities-table-config.models'; import { EntityTypeResource } from '@shared/models/entity-type.models'; import { Direction } from '@shared/models/page/sort-order'; -import { NotificationTemplate } from '@shared/models/notification.models'; +import { NotificationTemplate, NotificationTemplateTypeTranslateMap } from '@shared/models/notification.models'; import { NotificationService } from '@core/http/notification.service'; import { EntityAction } from '@home/models/entity/entity-component.models'; import { MatDialog } from '@angular/material/dialog'; @@ -61,7 +61,8 @@ export class TemplateTableConfig extends EntityTableConfig this.defaultSortOrder = {property: 'notificationType', direction: Direction.ASC}; this.columns.push( - new EntityTableColumn('notificationType', 'notification.type', '15%'), + new EntityTableColumn('notificationType', 'notification.type', '15%', + (template) => this.translate.instant(NotificationTemplateTypeTranslateMap.get(template.notificationType).name)), new EntityTableColumn('name', 'notification.template', '25%'), new EntityTableColumn('configuration.notificationSubject', 'notification.subject', '25%', (template) => template.configuration.notificationSubject, () => ({}), false), @@ -71,10 +72,22 @@ export class TemplateTableConfig extends EntityTableConfig } private configureCellActions(): Array> { - return []; + return [ + { + name: this.translate.instant('notification.copy-template'), + icon: 'content_copy', + isEnabled: () => true, + onAction: ($event, entity) => this.editTemplate($event, entity, false, true) + }, { + name: this.translate.instant('notification.edit-template'), + icon: 'edit', + isEnabled: () => true, + onAction: ($event, entity) => this.editTemplate($event, entity) + } + ]; } - private editTemplate($event: Event, template: NotificationTemplate, isAdd = false) { + private editTemplate($event: Event, template: NotificationTemplate, isAdd = false, isCopy = false) { if ($event) { $event.stopPropagation(); } @@ -84,6 +97,7 @@ export class TemplateTableConfig extends EntityTableConfig panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], data: { isAdd, + isCopy, template } }).afterClosed() 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 ecf3634799..5373217d56 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 @@ -16,7 +16,7 @@ --> -

notification.new-notification

+

{{ dialogTitle | translate }}