Browse Source

Fixed notification rules page not working when rule saved without additional config

pull/8951/head
rusikv 3 years ago
parent
commit
bebd5021ee
  1. 2
      ui-ngx/src/app/modules/home/pages/notification/rule/rule-table-config.resolver.ts
  2. 2
      ui-ngx/src/app/shared/models/notification.models.ts

2
ui-ngx/src/app/modules/home/pages/notification/rule/rule-table-config.resolver.ts

@ -81,7 +81,7 @@ export class RuleTableConfigResolver implements Resolve<EntityTableConfig<Notifi
(rule) => this.translate.instant(TriggerTypeTranslationMap.get(rule.triggerType)) || '', (rule) => this.translate.instant(TriggerTypeTranslationMap.get(rule.triggerType)) || '',
() => ({}), true), () => ({}), true),
new EntityTableColumn<NotificationRule>('additionalConfig.description', 'notification.description', '30%', new EntityTableColumn<NotificationRule>('additionalConfig.description', 'notification.description', '30%',
(target) => target.additionalConfig.description || '', (target) => target.additionalConfig?.description || '',
() => ({}), false) () => ({}), false)
); );
} }

2
ui-ngx/src/app/shared/models/notification.models.ts

@ -116,7 +116,7 @@ export interface NotificationRule extends Omit<BaseData<NotificationRuleId>, 'la
triggerType: TriggerType; triggerType: TriggerType;
triggerConfig: NotificationRuleTriggerConfig; triggerConfig: NotificationRuleTriggerConfig;
recipientsConfig: NotificationRuleRecipientConfig; recipientsConfig: NotificationRuleRecipientConfig;
additionalConfig: {description: string}; additionalConfig?: {description: string};
} }
export type NotificationRuleTriggerConfig = Partial<AlarmNotificationRuleTriggerConfig & DeviceInactivityNotificationRuleTriggerConfig & export type NotificationRuleTriggerConfig = Partial<AlarmNotificationRuleTriggerConfig & DeviceInactivityNotificationRuleTriggerConfig &

Loading…
Cancel
Save