Browse Source

UI: Refactoring

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

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

@ -154,7 +154,6 @@ export class SentNotificationDialogComponent extends
let useTemplate = true;
if (isDefinedAndNotNull(this.data.request.template)) {
useTemplate = false;
this.refreshAllowDeliveryMethod();
// eslint-disable-next-line guard-for-in
for (const method in this.data.request.template.configuration.deliveryMethodsTemplates) {
this.deliveryMethodFormsMap.get(NotificationDeliveryMethod[method])
@ -163,6 +162,7 @@ export class SentNotificationDialogComponent extends
}
this.notificationRequestForm.get('useTemplate').setValue(useTemplate, {onlySelf : true});
}
this.refreshAllowDeliveryMethod();
}
ngOnDestroy() {
@ -336,8 +336,10 @@ export class SentNotificationDialogComponent extends
refreshAllowDeliveryMethod() {
this.notificationService.getAvailableDeliveryMethods({ignoreLoading: true}).subscribe(allowMethods => {
this.allowNotificationDeliveryMethods = allowMethods;
this.updateDeliveryMethodsDisableState();
this.showRefresh = (this.notificationDeliveryMethods.length !== allowMethods.length);
if (!this.notificationRequestForm.get('useTemplate').value) {
this.updateDeliveryMethodsDisableState();
this.showRefresh = (this.notificationDeliveryMethods.length !== allowMethods.length);
}
});
}

Loading…
Cancel
Save