diff --git a/.github/workflows/build-template.yml b/.github/workflows/build-template.yml index 5cad06216..160d98b5c 100644 --- a/.github/workflows/build-template.yml +++ b/.github/workflows/build-template.yml @@ -56,7 +56,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ inputs.REGISTRY }}/${{ inputs.IMAGE_NAME }} + images: ${{ inputs.REGISTRY }}${{ inputs.IMAGE_NAME }} tags: | type=ref,event=branch type=ref,event=pr diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html index a2ffed4c8..187ff7831 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.html @@ -1,189 +1,181 @@ -
-
-
-

- Do you have any pets that live in the same household with you? -

+
+
+ +

+ Do you have any pets that live in the same household with you? +

- + - - {{ option.name }} - - - Confirm to have pets is required - - + {{ option.name }} + + + Confirm to have pets is required + + -
-
-
- -
+
+
+
+ +
- - - Pet Type - - Pet Type: - {{ element.type }} - - + + + Pet Type + + Pet Type: + {{ element.type }} + + - - How Many - - How Many: - {{ element.quantity }} - - + + How Many + + How Many: + {{ element.quantity }} + + - - - - + + + + - - - + + + - - - -
+ + +
+
-
- +
+ -
-
- -
+
+
+ +
-
- -
+
+
- - +
+ -
-
-
- -
-
-

- Livestock: Relocation planning should be considered to help - ensure producers are as prepared as possible for a range of - emergencies that may require the relocation of their livestock. - Further information and support may be available through the - Ministry of Agriculture. -

-
+
+
+
+
-
-
- -
-
-

- Hobby Farms: If you are a non-farm business owner of - livestock or pets, ensure you have the appropriate evacuation plan - in place to care for your hobby farm animals during an emergency - event. Further information and support may be available from your - Local Authority or First Nation and through the Canadian Disaster - Animal Response Team (CDART). -

-
+
+

+ Livestock: Relocation planning should be considered to help + ensure producers are as prepared as possible for a range of + emergencies that may require the relocation of their livestock. + Further information and support may be available through the + Ministry of Agriculture. +

+
+
+
+
+ +
+
+

+ Hobby Farms: If you are a non-farm business owner of + livestock or pets, ensure you have the appropriate evacuation plan + in place to care for your hobby farm animals during an emergency + event. Further information and support may be available from your + Local Authority or First Nation and through the Canadian Disaster + Animal Response Team (CDART). +

- +
diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts index 25348fdee..e6695aec0 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.component.ts @@ -1,4 +1,10 @@ -import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core'; +import { + Component, + EventEmitter, + OnDestroy, + OnInit, + Output +} from '@angular/core'; import { AbstractControl, UntypedFormBuilder, @@ -24,6 +30,7 @@ import { TabModel } from 'src/app/core/models/tab.model'; styleUrls: ['./animals.component.scss'] }) export class AnimalsComponent implements OnInit, OnDestroy { + @Output() validPetsIndicator: any = new EventEmitter(); animalsForm: UntypedFormGroup; radioOption = globalConst.radioButtonOptions; showPetsForm = false; @@ -33,9 +40,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { editIndex: number; rowEdit = false; showTable = true; - tabUpdateSubscription: Subscription; - tabMetaData: TabModel; - @Output() ValidPetsIndicator: any = new EventEmitter(); constructor( private router: Router, @@ -44,7 +48,7 @@ export class AnimalsComponent implements OnInit, OnDestroy { private customValidation: CustomValidationService, private formBuilder: UntypedFormBuilder, private wizardService: WizardService - ) { } + ) {} ngOnInit(): void { // Creates the Animals form @@ -54,32 +58,14 @@ export class AnimalsComponent implements OnInit, OnDestroy { this.petSource.next(this.animalsForm.get('pets').value); this.pets = this.animalsForm.get('pets').value; - if (this.animalsForm.get('hasPets').value === 'No' || (this.animalsForm.get('hasPets').value === 'Yes' && this.pets.length > 0)) { - this.ValidPetsIndicator.emit(true); - - - } - else - this.ValidPetsIndicator.emit(false); - // Set "update tab status" method, called for any tab navigation - this.tabUpdateSubscription = - this.stepEssFileService.nextTabUpdate.subscribe(() => { - this.updateTabStatus(); - }); + this.runValidation(); this.animalsForm.valueChanges.subscribe(() => { - if (this.animalsForm.get('hasPets').value === 'No' || (this.animalsForm.get('hasPets').value === 'Yes' && this.pets.length > 0)) { - this.ValidPetsIndicator.emit(true); - } else - this.ValidPetsIndicator.emit(false); - - }) + this.runValidation(); + }); // Update Value and Validity for pets form if hasPets changes this.animalsForm.get('hasPets').valueChanges.subscribe(() => { - this.animalsForm.get('pets').updateValueAndValidity(); - - }); // Updates the validations for the PetFormGroup @@ -95,8 +81,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { this.addPets(); this.showPetsForm = true; } - - this.tabMetaData = this.stepEssFileService.getNavLinks('animals'); } hasPetsChange(event: MatRadioChange): void { @@ -217,8 +201,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { this.animalsForm.get('addPetIndicator').setValue(true); } - - /** * When navigating away from tab, update variable value and status indicator */ @@ -237,8 +219,6 @@ export class AnimalsComponent implements OnInit, OnDestroy { }); this.stepEssFileService.updateEditedFormStatus(); } - this.stepEssFileService.nextTabUpdate.next(); - this.tabUpdateSubscription.unsubscribe(); } /** @@ -314,15 +294,15 @@ export class AnimalsComponent implements OnInit, OnDestroy { /** * Updates the Tab Status from Incomplete, Complete or in Progress */ - private updateTabStatus() { + private runValidation() { if (this.animalsForm.valid) { - this.stepEssFileService.setTabStatus('animals', 'complete'); + this.validPetsIndicator.emit(true); } else if ( this.stepEssFileService.checkForPartialUpdates(this.animalsForm) ) { - this.stepEssFileService.setTabStatus('animals', 'incomplete'); + this.validPetsIndicator.emit(false); } else { - this.stepEssFileService.setTabStatus('animals', 'not-started'); + this.validPetsIndicator.emit(false); } this.saveFormData(); } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.module.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.module.ts index 3cf07976c..5ab050401 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.module.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/animals/animals.module.ts @@ -15,6 +15,7 @@ import { SharedModule } from 'src/app/shared/shared.module'; MaterialModule, ReactiveFormsModule, SharedModule - ] + ], + exports: [AnimalsComponent] }) export class AnimalsModule {} diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html index f4448b452..a994f7e34 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.html @@ -7,21 +7,17 @@
+ + - - - - -
-
- -
-
- +
+
+ +
+
+ +
-
diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts index 9aa99a64c..0ffb70101 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.component.ts @@ -1,25 +1,22 @@ -import { Component, OnInit } from "@angular/core"; -import { UntypedFormBuilder } from "@angular/forms"; -import { MatDialog } from "@angular/material/dialog"; -import { Router } from "@angular/router"; -import { TabModel } from "src/app/core/models/tab.model"; -import { CustomValidationService } from "src/app/core/services/customValidation.service"; -import { StepEssFileService } from "../../step-ess-file/step-ess-file.service"; -import { WizardService } from "../../wizard.service"; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { UntypedFormBuilder } from '@angular/forms'; +import { MatDialog } from '@angular/material/dialog'; +import { Router } from '@angular/router'; +import { TabModel } from 'src/app/core/models/tab.model'; +import { CustomValidationService } from 'src/app/core/services/customValidation.service'; +import { StepEssFileService } from '../../step-ess-file/step-ess-file.service'; +import { WizardService } from '../../wizard.service'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-household-members-pets', templateUrl: './household-members-pets.component.html', styleUrls: ['./household-members-pets.component.scss'] }) - - -export class HouseholdMembersPetsComponent implements OnInit { - - +export class HouseholdMembersPetsComponent implements OnInit, OnDestroy { petsValid = false; householdMembersValid = false; - householdMembersQuantityValid = true; + tabUpdateSubscription: Subscription; tabMetaData: TabModel; constructor( @@ -28,17 +25,28 @@ export class HouseholdMembersPetsComponent implements OnInit { private stepEssFileService: StepEssFileService, private customValidation: CustomValidationService, private formBuilder: UntypedFormBuilder, - private wizardService: WizardService) { + private wizardService: WizardService + ) {} + ngOnInit(): void { + this.tabMetaData = this.stepEssFileService.getNavLinks( + 'household-members-pets' + ); + // Set "update tab status" method, called for any tab navigation + this.tabUpdateSubscription = + this.stepEssFileService.nextTabUpdate.subscribe(() => { + this.updateTabStatus(); + }); } - - ngOnInit(): void { - this.tabMetaData = this.stepEssFileService.getNavLinks('household-members-pets'); + ngOnDestroy(): void { + this.tabUpdateSubscription.unsubscribe(); + this.stepEssFileService.nextTabUpdate.next(); } + /** - * Goes back to the previous ESS File Tab - */ + * Goes back to the previous ESS File Tab + */ back() { this.updateTabStatus(); this.router.navigate([this.tabMetaData?.previous]); @@ -51,19 +59,32 @@ export class HouseholdMembersPetsComponent implements OnInit { this.updateTabStatus(); this.router.navigate([this.tabMetaData?.next]); } - ValidPetsIndicator(data): void { this.petsValid = data } - ValidHouseholdMemebersIndicator(data): void { this.householdMembersValid = data } - ValidSelectedHouseholdMembers(data): void { this.householdMembersQuantityValid = data } + validPetsIndicator(data): void { + this.petsValid = data; + this.updateTabStatus(); + } + + validHouseholdMemebersIndicator(data): void { + this.householdMembersValid = data; + this.updateTabStatus(); + } private updateTabStatus() { - if (this.petsValid && this.householdMembersValid && this.householdMembersQuantityValid) { - this.stepEssFileService.setTabStatus('household-members-pets', 'complete'); + if (this.petsValid && this.householdMembersValid) { + this.stepEssFileService.setTabStatus( + 'household-members-pets', + 'complete' + ); } else if (!this.petsValid && !this.householdMembersValid) { - this.stepEssFileService.setTabStatus('household-members-pets', 'not-started'); - } else if (!this.petsValid || !this.householdMembersValid || !this.householdMembersQuantityValid) { - this.stepEssFileService.setTabStatus('household-members-pets', 'incomplete'); + this.stepEssFileService.setTabStatus( + 'household-members-pets', + 'not-started' + ); + } else if (!this.petsValid || !this.householdMembersValid) { + this.stepEssFileService.setTabStatus( + 'household-members-pets', + 'incomplete' + ); } } } - - diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.module.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.module.ts index d2fbda10d..be9e93ea8 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.module.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members-pets/household-members-pets.module.ts @@ -6,17 +6,19 @@ import { HouseholdMembersPetsComponent } from './household-members-pets.componen import { MaterialModule } from 'src/app/material.module'; import { ReactiveFormsModule } from '@angular/forms'; import { SharedModule } from 'src/app/shared/shared.module'; -import { HouseholdMembersComponent } from '../household-members/household-members.component'; -import { AnimalsComponent } from '../animals/animals.component'; +import { AnimalsModule } from '../animals/animals.module'; +import { HouseholdMembersModule } from '../household-members/household-members.module'; @NgModule({ - declarations: [HouseholdMembersPetsComponent, HouseholdMembersComponent, AnimalsComponent], + declarations: [HouseholdMembersPetsComponent], imports: [ CommonModule, HouseholdMembersPetsRoutingModule, MaterialModule, ReactiveFormsModule, - SharedModule + SharedModule, + HouseholdMembersModule, + AnimalsModule ] }) export class HouseholdMembersPetsModule {} diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.ts index f29c3dedb..de485c936 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.component.ts @@ -1,4 +1,10 @@ -import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core'; +import { + Component, + EventEmitter, + OnDestroy, + OnInit, + Output +} from '@angular/core'; import { AbstractControl, UntypedFormBuilder, @@ -28,6 +34,7 @@ import { AppBaseService } from 'src/app/core/services/helper/appBase.service'; styleUrls: ['./household-members.component.scss'] }) export class HouseholdMembersComponent implements OnInit, OnDestroy { + @Output() validHouseholdMemebersIndicator = new EventEmitter(); householdForm: UntypedFormGroup; memberSource = new BehaviorSubject([]); selection = new SelectionModel(true, []); @@ -42,22 +49,17 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { newMembersColumns: string[] = ['members', 'buttons']; editMembersColumns: string[] = ['select', 'members', 'buttons']; membersColumns: string[] = []; - tabUpdateSubscription: Subscription; memberTipText: string; - tabMetaData: TabModel; - @Output() ValidHouseholdMemebersIndicator: any = new EventEmitter(); - @Output() ValidSelectedHouseholdMembers: any = new EventEmitter(); constructor( public stepEssFileService: StepEssFileService, private dialog: MatDialog, private formBuilder: UntypedFormBuilder, private customValidation: CustomValidationService, - private router: Router, private householdService: HouseholdMembersService, private wizardService: WizardService, private appBaseService: AppBaseService - ) { } + ) {} ngOnInit(): void { this.memberTipText = this.appBaseService?.wizardProperties?.memberTipText; @@ -83,12 +85,6 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { } } - if ((this.householdForm.get('hasHouseholdMembers').value === 'No' && (this.householdForm.get('houseHoldMember').valid)) || (this.householdForm.get('hasHouseholdMembers').value === 'Yes' && this.memberSource.value.length > 1)) { - this.ValidHouseholdMemebersIndicator.emit(true); - } - else - this.ValidHouseholdMemebersIndicator.emit(false); - // Displaying household member form in case 'haveHouseholdMembers' has been set to true if ( this.stepEssFileService.haveHouseHoldMembers === 'Yes' && @@ -105,30 +101,21 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { this.householdForm.get('houseHoldMember').markAllAsTouched(); } - // Set "update tab status" method, called for any tab navigation - this.tabUpdateSubscription = - this.stepEssFileService.nextTabUpdate.subscribe(() => { - this.updateTabStatus(); - }); - // Updates the status of the form according to changes this.householdForm .get('addMemberFormIndicator') .valueChanges.subscribe(() => { this.updateOnVisibility(); - } - ); + }); + this.runValidation(); this.householdForm.valueChanges.subscribe(() => { - if ((this.householdForm.get('hasHouseholdMembers').value === 'No' && (this.householdForm.get('houseHoldMember').valid)) || (this.householdForm.get('hasHouseholdMembers').value === 'Yes' && this.memberSource.value.length > 1)) { - this.ValidHouseholdMemebersIndicator.emit(true); - } else - this.ValidHouseholdMemebersIndicator.emit(false); - - }) - - this.tabMetaData = this.stepEssFileService.getNavLinks('household-members'); + this.runValidation(); + }); + this.selection.changed.subscribe(() => { + this.runValidation(); + }); } /** @@ -267,7 +254,6 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { isAllSelected() { const numSelected = this.selection.selected.length; const numRows = this.members.length; - this.ValidSelectedHouseholdMembers.emit(numSelected > 0); return numSelected === numRows; } @@ -289,20 +275,6 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { return `${this.selection.isSelected(row) ? 'deselect' : 'select'}`; } - /** - * Goes back to the previous tab from the ESS File Wizard - */ - back(): void { - this.router.navigate([this.tabMetaData?.previous]); - } - - /** - * Goes to the next tab from the ESS File Wizard - */ - next(): void { - this.router.navigate([this.tabMetaData?.next]); - } - /** * When navigating away from tab, update variable value and status indicator */ @@ -320,8 +292,7 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { }); this.stepEssFileService.updateEditedFormStatus(); } - this.stepEssFileService.nextTabUpdate.next(); - this.tabUpdateSubscription.unsubscribe(); + //this.stepEssFileService.nextTabUpdate.next(); } /** @@ -415,10 +386,7 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { this.householdService.updateOnVisibility(this.householdForm); } - /** - * Updates the Tab Status from Incomplete, Complete or in Progress - */ - private updateTabStatus() { + private runValidation() { // Remove Edit form if displayed while tabbing out if (this.editFlag) this.cancel(); @@ -431,16 +399,15 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { this.members.length < 2 ) ) { - this.stepEssFileService.setTabStatus('household-members', 'complete'); + this.validHouseholdMemebersIndicator.emit(true); } else if ( this.stepEssFileService.checkForPartialUpdates(this.householdForm) ) { - this.stepEssFileService.setTabStatus('household-members', 'incomplete'); + this.validHouseholdMemebersIndicator.emit(false); + //this.stepEssFileService.setTabStatus('household-members', 'incomplete'); } else { - this.stepEssFileService.setTabStatus( - 'household-members', - 'not-started' - ); + this.validHouseholdMemebersIndicator.emit(false); + //this.stepEssFileService.setTabStatus('household-members', 'not-started'); } } else if (this.essFileNumber) { if ( @@ -448,16 +415,16 @@ export class HouseholdMembersComponent implements OnInit, OnDestroy { this.householdForm.get('addMemberIndicator').value === false && this.selection.selected.length >= 1 ) { - this.stepEssFileService.setTabStatus('household-members', 'complete'); + this.validHouseholdMemebersIndicator.emit(true); + // this.stepEssFileService.setTabStatus('household-members', 'complete'); } else if ( this.stepEssFileService.checkForPartialUpdates(this.householdForm) ) { - this.stepEssFileService.setTabStatus('household-members', 'incomplete'); + this.validHouseholdMemebersIndicator.emit(false); + //this.stepEssFileService.setTabStatus('household-members', 'incomplete'); } else { - this.stepEssFileService.setTabStatus( - 'household-members', - 'not-started' - ); + this.validHouseholdMemebersIndicator.emit(false); + //this.stepEssFileService.setTabStatus('household-members', 'not-started'); } } diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.module.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.module.ts index d8db8a72b..69d07cadb 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.module.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/ess-file-components/household-members/household-members.module.ts @@ -15,6 +15,7 @@ import { SharedModule } from 'src/app/shared/shared.module'; MaterialModule, ReactiveFormsModule, SharedModule - ] + ], + exports: [HouseholdMembersComponent] }) export class HouseholdMembersModule {} diff --git a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts index 6d40cd11a..6eb173769 100644 --- a/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts +++ b/responders/src/UI/embc-responder/src/app/feature-components/wizard/step-ess-file/step-ess-file.service.ts @@ -56,7 +56,6 @@ export class StepEssFileService { private facilityNameVal: string; private insuranceVal: InsuranceOption; - // Household Members & Pets tab private haveHouseHoldMembersVal: string; private householdMembersVal: HouseholdMemberModel[]; @@ -469,9 +468,9 @@ export class StepEssFileService { const needsObject: NeedsAssessment = { insurance: this.insurance, - + householdMembers: this.selectedHouseholdMembers, - + pets: this.petsList, canProvideFood: needsFoodDTO,