Browse Source
Merge pull request #8333 from vvlladd28/improvement/notification/disable-change-type
Change notification template/rule type disabled in edit mode
pull/5311/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
1 deletions
-
ui-ngx/src/app/modules/home/pages/notification/rule/rule-notification-dialog.component.ts
-
ui-ngx/src/app/modules/home/pages/notification/template/template-notification-dialog.component.ts
|
|
|
@ -313,6 +313,8 @@ export class RuleNotificationDialogComponent extends |
|
|
|
if (this.ruleNotification) { |
|
|
|
if (this.data.isCopy) { |
|
|
|
this.ruleNotification.name += ` (${this.translate.instant('action.copy')})`; |
|
|
|
} else { |
|
|
|
this.ruleNotificationForm.get('triggerType').disable({emitEvent: false}); |
|
|
|
} |
|
|
|
this.ruleNotificationForm.reset({}, {emitEvent: false}); |
|
|
|
this.ruleNotificationForm.patchValue(this.ruleNotification, {emitEvent: false}); |
|
|
|
|
|
|
|
@ -87,7 +87,7 @@ export class TemplateNotificationDialogComponent |
|
|
|
|
|
|
|
if (isDefinedAndNotNull(this.data?.predefinedType)) { |
|
|
|
this.hideSelectType = true; |
|
|
|
this.templateNotificationForm.get('notificationType').setValue(this.data.predefinedType, {emitEvents: false}); |
|
|
|
this.templateNotificationForm.get('notificationType').setValue(this.data.predefinedType, {emitEvent: false}); |
|
|
|
} |
|
|
|
|
|
|
|
if (data.isAdd || data.isCopy) { |
|
|
|
@ -98,6 +98,8 @@ export class TemplateNotificationDialogComponent |
|
|
|
if (this.templateNotification) { |
|
|
|
if (this.data.isCopy) { |
|
|
|
this.templateNotification.name += ` (${this.translate.instant('action.copy')})`; |
|
|
|
} else { |
|
|
|
this.templateNotificationForm.get('notificationType').disable({emitEvent: false}); |
|
|
|
} |
|
|
|
this.templateNotificationForm.reset({}, {emitEvent: false}); |
|
|
|
this.templateNotificationForm.patchValue(this.templateNotification, {emitEvent: false}); |
|
|
|
|