Fix client address acording to enable address system setting

This commit is contained in:
Jose Alberto Hernandez
2022-06-25 08:26:33 -05:00
parent 4d28ef9044
commit 815071cc19
4 changed files with 19 additions and 12 deletions
@@ -162,7 +162,7 @@
</div> </div>
<div fxFlexFill *ngIf="client.address.length" fxLayout="row wrap" fxLayout.lt-md="column"> <div fxFlexFill *ngIf="clientTemplate.isAddressEnabled && client.address.length" fxLayout="row wrap" fxLayout.lt-md="column">
<h3 class="mat-h3" fxFlexFill>Address</h3> <h3 class="mat-h3" fxFlexFill>Address</h3>
@@ -120,7 +120,7 @@
General General
</a> </a>
<a mat-tab-link [routerLink]="['./address']" routerLinkActive #address="routerLinkActive" <a mat-tab-link [routerLink]="['./address']" routerLinkActive #address="routerLinkActive"
[active]="address.isActive" *ngIf="clientTemplateData.isAddressEnabled"> [active]="address.isActive">
Address Address
</a> </a>
<a mat-tab-link [routerLink]="['./family-members']" routerLinkActive #familyMembers="routerLinkActive" <a mat-tab-link [routerLink]="['./family-members']" routerLinkActive #familyMembers="routerLinkActive"
@@ -38,7 +38,7 @@
</mat-step> </mat-step>
<mat-step> <mat-step *ngIf="clientTemplate.isAddressEnabled">
<ng-template matStepLabel>ADDRESS</ng-template> <ng-template matStepLabel>ADDRESS</ng-template>
@@ -64,11 +64,18 @@ export class CreateClientComponent {
* Retrieves the client object * Retrieves the client object
*/ */
get client() { get client() {
if (this.clientTemplate.isAddressEnabled) {
return { return {
...this.clientGeneralStep.clientGeneralDetails, ...this.clientGeneralStep.clientGeneralDetails,
...this.clientFamilyMembersStep.familyMembers, ...this.clientFamilyMembersStep.familyMembers,
...this.clientAddressStep.address ...this.clientAddressStep.address
}; };
} else {
return {
...this.clientGeneralStep.clientGeneralDetails,
...this.clientFamilyMembersStep.familyMembers
};
}
} }
/** /**
* Submits the create client form. * Submits the create client form.