Browse Source

UI: Fixed notify again dialog with template

pull/8784/head
Artem Dzhereleiko 3 years ago
parent
commit
a599059955
  1. 21
      ui-ngx/src/app/modules/home/pages/notification/sent/sent-notification-dialog.componet.ts

21
ui-ngx/src/app/modules/home/pages/notification/sent/sent-notification-dialog.componet.ts

@ -154,6 +154,7 @@ export class SentNotificationDialogComponent extends
let useTemplate = true; let useTemplate = true;
if (isDefinedAndNotNull(this.data.request.template)) { if (isDefinedAndNotNull(this.data.request.template)) {
useTemplate = false; useTemplate = false;
this.refreshAllowDeliveryMethod();
// eslint-disable-next-line guard-for-in // eslint-disable-next-line guard-for-in
for (const method in this.data.request.template.configuration.deliveryMethodsTemplates) { for (const method in this.data.request.template.configuration.deliveryMethodsTemplates) {
this.deliveryMethodFormsMap.get(NotificationDeliveryMethod[method]) this.deliveryMethodFormsMap.get(NotificationDeliveryMethod[method])
@ -162,8 +163,6 @@ export class SentNotificationDialogComponent extends
} }
this.notificationRequestForm.get('useTemplate').setValue(useTemplate, {onlySelf : true}); this.notificationRequestForm.get('useTemplate').setValue(useTemplate, {onlySelf : true});
} }
this.refreshAllowDeliveryMethod();
} }
ngOnDestroy() { ngOnDestroy() {
@ -343,13 +342,15 @@ export class SentNotificationDialogComponent extends
} }
private updateDeliveryMethodsDisableState() { private updateDeliveryMethodsDisableState() {
this.notificationDeliveryMethods.forEach(method => { if (this.allowNotificationDeliveryMethods) {
if (this.allowNotificationDeliveryMethods.includes(method)) { this.notificationDeliveryMethods.forEach(method => {
this.getDeliveryMethodsTemplatesControl(method).enable({emitEvent: true}); if (this.allowNotificationDeliveryMethods.includes(method)) {
} else { this.getDeliveryMethodsTemplatesControl(method).enable({emitEvent: true});
this.getDeliveryMethodsTemplatesControl(method).disable({emitEvent: true}); } else {
this.getDeliveryMethodsTemplatesControl(method).setValue(false, {emitEvent: true}); //used for notify again this.getDeliveryMethodsTemplatesControl(method).disable({emitEvent: true});
} this.getDeliveryMethodsTemplatesControl(method).setValue(false, {emitEvent: true}); //used for notify again
}); }
});
}
} }
} }

Loading…
Cancel
Save