mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#1407 Checkout Notification Channels Bugfix, Close Form, Reducer Update
This commit is contained in:
@@ -20,12 +20,22 @@ const _domainCheckoutReducer = createReducer(
|
||||
}),
|
||||
on(DomainCheckoutActions.setNotificationEmail, (s, { processId, email }) => {
|
||||
const entity = getOrCreateCheckoutEntity({ processId, entities: s.entities });
|
||||
entity.buyer.communicationDetails.email = email;
|
||||
const communicationDetails = { ...entity.buyer.communicationDetails };
|
||||
communicationDetails.email = email;
|
||||
entity.buyer = {
|
||||
...entity.buyer,
|
||||
communicationDetails,
|
||||
};
|
||||
return storeCheckoutAdapter.setOne(entity, s);
|
||||
}),
|
||||
on(DomainCheckoutActions.setNotificationMobile, (s, { processId, mobile }) => {
|
||||
const entity = getOrCreateCheckoutEntity({ processId, entities: s.entities });
|
||||
entity.buyer.communicationDetails.mobile = mobile;
|
||||
const communicationDetails = { ...entity.buyer.communicationDetails };
|
||||
communicationDetails.mobile = mobile;
|
||||
entity.buyer = {
|
||||
...entity.buyer,
|
||||
communicationDetails,
|
||||
};
|
||||
return storeCheckoutAdapter.setOne(entity, s);
|
||||
}),
|
||||
on(DomainCheckoutActions.setCheckoutDestination, (s, { processId, destination }) => {
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" *ngIf="editFormFields && customer$ | async; let customer">
|
||||
<page-notification-edit (editMode)="editDone()" [customer]="customer" [editFields]="editFields"></page-notification-edit>
|
||||
<div class="row" *ngIf="editFormFields && editMode && customer$ | async; let customer">
|
||||
<page-notification-edit
|
||||
(closeEditForm)="closeEditForm()"
|
||||
(editMode)="editDone()"
|
||||
[customer]="customer"
|
||||
[editFields]="editFields"
|
||||
></page-notification-edit>
|
||||
</div>
|
||||
|
||||
@@ -43,4 +43,9 @@ export class NotificationChannelsComponent implements OnInit {
|
||||
this.editFormFields = true;
|
||||
this.editFields = editFields;
|
||||
}
|
||||
|
||||
closeEditForm() {
|
||||
this.editFormFields = false;
|
||||
this.editFields = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ export class NotificationEditComponent implements OnInit {
|
||||
@Input() customer: CustomerDTO;
|
||||
@Input() editFields: { email?: boolean; sms?: boolean };
|
||||
@Output() editMode = new EventEmitter<void>();
|
||||
@Output() closeEditForm = new EventEmitter<void>();
|
||||
control: FormGroup;
|
||||
constructor(
|
||||
private applicationService: ApplicationService,
|
||||
@@ -40,8 +41,6 @@ export class NotificationEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
async submit() {
|
||||
this.editMode.emit();
|
||||
|
||||
if (!this.control.valid || !this.control.enabled) {
|
||||
return;
|
||||
}
|
||||
@@ -62,5 +61,7 @@ export class NotificationEditComponent implements OnInit {
|
||||
this.control.enable();
|
||||
console.error(err);
|
||||
}
|
||||
this.closeEditForm.emit();
|
||||
this.editMode.emit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user