Browse Source

Merge pull request #8784 from ArtemDzhereleiko/AD/bug-fix/notification-center/notify-again

Fixed 'Notify again' dialog in notification center
pull/8849/head
Igor Kulikov 3 years ago
committed by GitHub
parent
commit
ef471e66e6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      ui-ngx/src/app/modules/home/pages/notification/sent/sent-notification-dialog.componet.ts

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

@ -162,7 +162,6 @@ export class SentNotificationDialogComponent extends
} }
this.notificationRequestForm.get('useTemplate').setValue(useTemplate, {onlySelf : true}); this.notificationRequestForm.get('useTemplate').setValue(useTemplate, {onlySelf : true});
} }
this.refreshAllowDeliveryMethod(); this.refreshAllowDeliveryMethod();
} }
@ -337,19 +336,23 @@ export class SentNotificationDialogComponent extends
refreshAllowDeliveryMethod() { refreshAllowDeliveryMethod() {
this.notificationService.getAvailableDeliveryMethods({ignoreLoading: true}).subscribe(allowMethods => { this.notificationService.getAvailableDeliveryMethods({ignoreLoading: true}).subscribe(allowMethods => {
this.allowNotificationDeliveryMethods = allowMethods; this.allowNotificationDeliveryMethods = allowMethods;
this.updateDeliveryMethodsDisableState(); if (!this.notificationRequestForm.get('useTemplate').value) {
this.showRefresh = (this.notificationDeliveryMethods.length !== allowMethods.length); this.updateDeliveryMethodsDisableState();
this.showRefresh = (this.notificationDeliveryMethods.length !== allowMethods.length);
}
}); });
} }
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