diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/evacuation-details/evacuation-details.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/evacuation-details/evacuation-details.component.ts index a7c68c86d..0c151c867 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/evacuation-details/evacuation-details.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/evacuation-details/evacuation-details.component.ts @@ -29,6 +29,7 @@ import { BcAddressComponent } from '../../../../shared/forms/address-forms/bc-ad import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker'; import { MatInput } from '@angular/material/input'; import { MatFormField, MatLabel, MatError, MatSuffix } from '@angular/material/form-field'; +import { Community } from 'src/app/core/services/locations.service'; @Component({ selector: 'app-evacuation-details', @@ -196,9 +197,9 @@ export class EvacuationDetailsComponent implements OnInit, OnDestroy { */ private createEvacDetailsForm(): void { this.evacDetailsForm = this.formBuilder.group({ - paperESSFile: [this.stepEssFileService.paperESSFile !== undefined ? this.stepEssFileService.paperESSFile : ''], + paperESSFile: [this.stepEssFileService.paperESSFile ?? ''], evacuatedFromPrimary: [ - this.stepEssFileService.evacuatedFromPrimary !== null ? this.stepEssFileService.evacuatedFromPrimary : '', + this.stepEssFileService.evacuatedFromPrimary ?? '', this.customValidation .conditionalValidation( () => this.evacDetailsForm.get('primaryAddressIndicator').value === true, @@ -206,14 +207,8 @@ export class EvacuationDetailsComponent implements OnInit, OnDestroy { ) .bind(this.customValidation) ], - facilityName: [ - this.stepEssFileService.facilityName !== undefined ? this.stepEssFileService.facilityName : '', - [this.customValidation.whitespaceValidator()] - ], - insurance: [ - this.stepEssFileService.insurance !== undefined ? this.stepEssFileService.insurance : '', - Validators.required - ], + facilityName: [this.stepEssFileService.facilityName ?? '', [this.customValidation.whitespaceValidator()]], + insurance: [this.stepEssFileService.insurance ?? '', Validators.required], primaryAddressIndicator: [true], evacAddress: this.createEvacAddressForm(), paperIssuedBy: this.formBuilder.group({ @@ -318,7 +313,10 @@ export class EvacuationDetailsComponent implements OnInit, OnDestroy { * Checks if the inserted primary address is in BC Province */ private checkAddress() { - if (this.stepEssFileService?.primaryAddress?.stateProvince?.code !== 'BC') { + if ( + this.stepEssFileService?.primaryAddress?.stateProvince?.code !== 'BC' || + !(this.stepEssFileService?.primaryAddress?.community as Community)?.code + ) { this.isBCAddress = false; // Make sure province/country are set to BC/Can whenever address form is displayed diff --git a/responders/src/UI/embc-responder/src/app/shared/forms/address-forms/can-address/can-address.component.html b/responders/src/UI/embc-responder/src/app/shared/forms/address-forms/can-address/can-address.component.html index 33f130f47..ede768a3a 100644 --- a/responders/src/UI/embc-responder/src/app/shared/forms/address-forms/can-address/can-address.component.html +++ b/responders/src/UI/embc-responder/src/app/shared/forms/address-forms/can-address/can-address.component.html @@ -61,7 +61,7 @@ /> @for (option of filteredOptions | async; track option) { - + {{ option.name }} } diff --git a/responders/src/UI/embc-responder/src/app/shared/pipes/maskEvacuatedAddress.pipe.ts b/responders/src/UI/embc-responder/src/app/shared/pipes/maskEvacuatedAddress.pipe.ts index e2e1adb09..8c9f6b069 100644 --- a/responders/src/UI/embc-responder/src/app/shared/pipes/maskEvacuatedAddress.pipe.ts +++ b/responders/src/UI/embc-responder/src/app/shared/pipes/maskEvacuatedAddress.pipe.ts @@ -23,8 +23,6 @@ export class MaskEvacuatedAddressPipe implements PipeTransform { */ transform(address: AddressModel): SafeHtml { if (address !== null && address !== undefined) { - const communities = this.locationService.getCommunityList(); - let line1 = address.addressLine1; let line2 = '';