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.refreshAllowDeliveryMethod();
}
@ -337,19 +336,23 @@ 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);
}
});
}
private updateDeliveryMethodsDisableState() {
this.notificationDeliveryMethods.forEach(method => {
if (this.allowNotificationDeliveryMethods.includes(method)) {
this.getDeliveryMethodsTemplatesControl(method).enable({emitEvent: true});
} else {
this.getDeliveryMethodsTemplatesControl(method).disable({emitEvent: true});
this.getDeliveryMethodsTemplatesControl(method).setValue(false, {emitEvent: true}); //used for notify again
}
});
if (this.allowNotificationDeliveryMethods) {
this.notificationDeliveryMethods.forEach(method => {
if (this.allowNotificationDeliveryMethods.includes(method)) {
this.getDeliveryMethodsTemplatesControl(method).enable({emitEvent: true});
} else {
this.getDeliveryMethodsTemplatesControl(method).disable({emitEvent: true});
this.getDeliveryMethodsTemplatesControl(method).setValue(false, {emitEvent: true}); //used for notify again
}
});
}
}
}

Loading…
Cancel
Save