diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/rule-table-config.ts b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/rule-table-config.ts index b62c111509..b89bdada7d 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/rule-table-config.ts +++ b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/rule-table-config.ts @@ -62,7 +62,7 @@ export class RuleTableConfig extends EntityTableConfig { this.deleteEntityContent = () => this.translate.instant('notification.delete-rule-text'); this.deleteEntity = id => this.notificationService.deleteNotificationRule(id.id); - // this.cellActionDescriptors = this.configureCellActions(); + this.cellActionDescriptors = this.configureCellActions(); this.headerComponent = RuleTableHeaderComponent; this.onEntityAction = action => this.onTargetAction(action); @@ -70,25 +70,31 @@ export class RuleTableConfig extends EntityTableConfig { this.columns.push( new EntityTableColumn('name', 'notification.rule-name', '30%'), - new EntityTableColumn('templateId', 'notification.template', '15%', - (rule) => `${rule.templateId.id}`, - () => ({}), false), - new EntityTableColumn('triggerType', 'notification.trigger.trigger', '15%', + new EntityTableColumn('templateName', 'notification.template', '20%'), + new EntityTableColumn('triggerType', 'notification.trigger.trigger', '20%', (rule) => this.translate.instant(TriggerTypeTranslationMap.get(rule.triggerType)) || '', - () => ({}), true) + () => ({}), true), + new EntityTableColumn('additionalConfig.description', 'notification.description', '30%', + (target) => target.additionalConfig.description || '', + () => ({}), false) ); } private configureCellActions(): Array> { return [{ - name: this.translate.instant('device.make-public'), + name: this.translate.instant('notification.copy-rule'), + icon: 'content_copy', + isEnabled: () => true, + onAction: ($event, entity) => this.editRule($event, entity, false, true) + }, { + name: this.translate.instant('notification.edit-rule'), icon: 'edit', isEnabled: () => true, - onAction: ($event, entity) => this.editTarget($event, entity) + onAction: ($event, entity) => this.editRule($event, entity) }]; } - private editTarget($event: Event, rule: NotificationRule, isAdd = false) { + private editRule($event: Event, rule: NotificationRule, isAdd = false, isCopy = false) { if ($event) { $event.stopPropagation(); } @@ -98,6 +104,7 @@ export class RuleTableConfig extends EntityTableConfig { panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], data: { isAdd, + isCopy, rule } }).afterClosed() @@ -111,7 +118,7 @@ export class RuleTableConfig extends EntityTableConfig { private onTargetAction(action: EntityAction): boolean { switch (action.action) { case 'add': - this.editTarget(action.event, action.entity, true); + this.editRule(action.event, action.entity, true); return true; } return false; diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalation-form.component.html b/ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalation-form.component.html index b6bac29dfb..397ced14d6 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalation-form.component.html +++ b/ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalation-form.component.html @@ -19,8 +19,8 @@
-
notification.first-recipient
-
+
notification.first-recipient
+
After
-

{{'notification.add-rule' | translate }}

+

{{ dialogTitle | translate }}