mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
#1438 Bugfix Notification Channels communicationDetails Error if Process gets Closed
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
<div class="notification-wrapper" *ngIf="!ncs.editMode.value">
|
||||
<div class="notification" *ngIf="notificationChannel$ | async; let notificationChannel">
|
||||
<ng-container *ngIf="communicationDetails$ | async; let communicationDetails">
|
||||
<div *ngIf="communicationDetails.email && notificationChannel !== 0" class="notification">
|
||||
<div *ngIf="communicationDetails?.email && notificationChannel !== 0" class="notification">
|
||||
<ui-icon class="icon-notification" icon="check"></ui-icon>
|
||||
<label class="notification-label">Email</label>
|
||||
</div>
|
||||
<div *ngIf="communicationDetails.mobile && notificationChannel !== 0" class="notification">
|
||||
<div *ngIf="communicationDetails?.mobile && notificationChannel !== 0" class="notification">
|
||||
<ui-icon class="icon-notification" icon="check"></ui-icon>
|
||||
<label class="notification-label">SMS</label>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@ export class NotificationChannelsComponent {
|
||||
communicationDetails$: Observable<CommunicationDetailsDTO> = this.applicationService.activatedProcessId$.pipe(
|
||||
switchMap((processId) => this.domainCheckoutService.getBuyer({ processId })),
|
||||
tap((buyer) => (this.ncs.buyer = buyer)),
|
||||
map((buyer) => buyer.communicationDetails)
|
||||
map((buyer) => buyer?.communicationDetails)
|
||||
);
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -29,14 +29,14 @@ export class NotificationEditComponent implements OnInit, OnDestroy {
|
||||
this.createForm();
|
||||
this.checkboxSubscription = this.ncs.checkboxes.subscribe((checkboxes) => {
|
||||
if (!!checkboxes.email && !this.ncs.hasEmail) {
|
||||
this.control.get('communicationDetails').get('email').enable();
|
||||
this.control?.get('communicationDetails')?.get('email')?.enable();
|
||||
} else {
|
||||
this.control.get('communicationDetails').get('email').disable();
|
||||
this.control?.get('communicationDetails')?.get('email')?.disable();
|
||||
}
|
||||
if (!!checkboxes.sms && !this.ncs.hasMobile) {
|
||||
this.control.get('communicationDetails').get('mobile').enable();
|
||||
this.control?.get('communicationDetails')?.get('mobile')?.enable();
|
||||
} else {
|
||||
this.control.get('communicationDetails').get('mobile').disable();
|
||||
this.control?.get('communicationDetails')?.get('mobile')?.disable();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -55,8 +55,8 @@ export class NotificationEditComponent implements OnInit, OnDestroy {
|
||||
mobile: fb.control(this.ncs.customer?.communicationDetails?.mobile, [Validators.required]),
|
||||
}),
|
||||
});
|
||||
this.control.get('communicationDetails').get('email').disable();
|
||||
this.control.get('communicationDetails').get('mobile').disable();
|
||||
this.control?.get('communicationDetails')?.get('email')?.disable();
|
||||
this.control?.get('communicationDetails')?.get('mobile')?.disable();
|
||||
this.cdr.markForCheck();
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ export class NotificationEditComponent implements OnInit, OnDestroy {
|
||||
|
||||
try {
|
||||
const processId = await this.applicationService.activatedProcessId$.pipe(first()).toPromise();
|
||||
const email = this.control.value.communicationDetails.email;
|
||||
const mobile = this.control.value.communicationDetails.mobile;
|
||||
const email = this.control?.value?.communicationDetails?.email;
|
||||
const mobile = this.control?.value?.communicationDetails?.mobile;
|
||||
let emailNotification: NotificationChannel;
|
||||
let smsNotification: NotificationChannel;
|
||||
if (!this.ncs.hasEmail && !!email) {
|
||||
|
||||
Reference in New Issue
Block a user