Skip to content

Commit

Permalink
Merge pull request bcgov#2067 from TimaQT/features/timaqt/EMBCESSMOD-…
Browse files Browse the repository at this point in the history
…5172

EMBCESSMOD-5172: Needs Assessment display issues
  • Loading branch information
ytqsl authored Apr 19, 2024
2 parents 203ea58 + 8866f52 commit bbd04e7
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public enum IdentifiedNeed
ShelterAllowance,

[Description("Transportation")]
Tranportation,
Transportation,

[Description("Food")]
Food,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export enum IdentifiedNeed {
ShelterReferral = 'ShelterReferral',
ShelterAllowance = 'ShelterAllowance',
Tranportation = 'Tranportation',
Transportation = 'Transportation',
Food = 'Food',
Incidentals = 'Incidentals',
Clothing = 'Clothing'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,6 @@ export const incidentalsNeedDialog: DialogContent = {
title: 'Incidentals',
text: 'Incidentals could include miscellaneous items such as personal hygiene products such as toothpaste, laundry soap and/or pet food.'
};

export const noAssistanceRequired =
'Household currently does not require assistance.';
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<div class="row">
<div class="col-12">
<div class="row" *ngIf="getIdentifiedNeeds().length === 0">
<div class="col-12 bold">Household currently does not require assistance.</div>
<div class="col-12 bold">{{noAssistanceRequiredMessage}}</div>
</div>
<div class="row" *ngFor="let item of getIdentifiedNeeds()">
<div class="col-12 bold">{{ item }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { EvacuationFileHouseholdMember } from 'src/app/core/api/models';
})
export class EssFileDetailsComponent implements OnInit {

noAssistanceRequiredMessage = globalConst.noAssistanceRequired;
memberListDisplay: EvacuationFileHouseholdMember[];

memberColumns: string[] = ['firstName', 'lastName', 'dateOfBirth'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<div class="col-md-9 table-parent">
<table class="table-details">
<tr *ngIf="getIdentifiedNeeds().length === 0">
<td><b>Household currently does not require assistance.</b></td>
<td><b>{{noAssistanceRequiredMessage}}</b></td>
</tr>
<tr *ngFor="let item of getIdentifiedNeeds()">
<th>{{ item }}</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as globalConst from '../../../../core/services/global-constants';
export class EssFileOverviewComponent implements OnInit {
essFile: EvacuationFileModel;
animalCount = 0;
noAssistanceRequiredMessage = globalConst.noAssistanceRequired;

constructor(
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
<div class="col-12 bold">{{ item }}</div>
</div>
<div class="row" *ngIf="stepEssFileService?.needsIdentified.length == 0">
<div class="col-12 bold">Household currently does not require assistance.</div>
<div class="col-12 bold">{{noAssistanceRequiredMessage}}</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class EssFileReviewComponent implements OnInit, OnDestroy {

petColumns: string[] = ['type', 'quantity'];
tabMetaData: TabModel;
noAssistanceRequiredMessage = globalConst.noAssistanceRequired;

constructor(
public stepEssFileService: StepEssFileService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@ export class StepEssFileService {
}

public get requiresTransportation(): boolean {
return this.needs.has(IdentifiedNeed.Tranportation);
return this.needs.has(IdentifiedNeed.Transportation);
}

public set requiresTransportation(checked: boolean) {
if (checked && !this.needs.has(IdentifiedNeed.Tranportation)) {
this.needs.add(IdentifiedNeed.Tranportation);
} else if (!checked && this.needs.has(IdentifiedNeed.Tranportation)) {
this.needs.delete(IdentifiedNeed.Tranportation);
if (checked && !this.needs.has(IdentifiedNeed.Transportation)) {
this.needs.add(IdentifiedNeed.Transportation);
} else if (!checked && this.needs.has(IdentifiedNeed.Transportation)) {
this.needs.delete(IdentifiedNeed.Transportation);
}
}
public get requiresShelterReferral(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,19 @@
<div
class="row"
*ngFor="
let item of evacueeSessionService?.currentNeedsAssessment?.needs
let item of getIdentifiedNeeds()
"
>
<div class="col-4">{{ item }}</div>
</div>
<div
class="row"
*ngIf="
getIdentifiedNeeds().length == 0
"
>
<div class="col-8">{{noAssistanceRequiredMessage}}</div>
</div>
</mat-card>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Code, SupportCategory, SupportSubCategory } from 'src/app/core/api/mode
import { EvacueeSessionService } from 'src/app/core/services/evacuee-session.service';
import { LoadEvacueeListService } from 'src/app/core/services/load-evacuee-list.service';
import { StepSupportsService } from '../../step-supports/step-supports.service';
import * as globalConst from '../../../../core/services/global-constants';

@Component({
selector: 'app-select-support',
Expand All @@ -19,6 +20,7 @@ import { StepSupportsService } from '../../step-supports/step-supports.service';
export class SelectSupportComponent implements OnInit {
supportList: Code[] = [];
supportTypeForm: UntypedFormGroup;
noAssistanceRequiredMessage = globalConst.noAssistanceRequired

constructor(
public stepSupportsService: StepSupportsService,
Expand All @@ -29,6 +31,7 @@ export class SelectSupportComponent implements OnInit {
) {}

ngOnInit(): void {

this.supportList = this.loadEvacueeListService
.getSupportTypeList()
.filter((element) => element.description !== '' && element.value !== SupportSubCategory.Lodging_Billeting && element.value !== SupportCategory.Lodging);
Expand All @@ -37,6 +40,15 @@ export class SelectSupportComponent implements OnInit {
this.createVerificationForm();
}

public getIdentifiedNeeds(): string[] {
return Array.from(this.evacueeSessionService?.currentNeedsAssessment?.needs ?? []).map(
(need) =>
this.loadEvacueeListService
?.getIdentifiedNeeds()
?.find((value) => value.value === need)?.description
);
}

createVerificationForm(): void {
this.supportTypeForm = this.formBuilder.group({
type: ['', [Validators.required]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export class WizardService {
form.requiresFood.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.Food) &&
form.requiresClothing.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.Clothing) &&
form.requiresIncidentals.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.Incidentals) &&
form.requiresTransportation.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.Tranportation) &&
form.requiresTransportation.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.Transportation) &&
form.requiresShelterAllowance.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.ShelterAllowance) &&
form.requiresShelterReferral.value === initialValue.needsAssessment.needs.indexOf(IdentifiedNeed.ShelterReferral)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,18 @@

<div
class="row row-padding"
*ngFor="let item of profileData.needsAssessment.needs"
*ngFor="let item of getIdentifiedNeeds()"
>
<div class="col-12 bold">
{{ item }}
</div>
</div>

<div
class="row row-padding"
*ngIf="getIdentifiedNeeds().length == 0"
>
<div class="col-12 bold">
{{noAssistanceRequiredMessage}}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DialogContent } from 'src/app/core/models/dialog-content.model';
import { EvacuationFileModel } from 'src/app/core/models/evacuation-file.model';
import { EvacueeSessionService } from 'src/app/core/services/evacuee-session.service';
import * as globalConst from '../../../../core/services/global-constants';
import { LoadEvacueeListService } from 'src/app/core/services/load-evacuee-list.service';

@Component({
selector: 'app-view-assessment-dialog',
Expand All @@ -16,10 +17,12 @@ export class ViewAssessmentDialogComponent implements OnInit {

memberColumns: string[] = ['firstName', 'lastName', 'dateOfBirth'];
petColumns: string[] = ['type', 'quantity'];
noAssistanceRequiredMessage = globalConst.noAssistanceRequired;
constructor(public evacueeSessionService: EvacueeSessionService,
private loadEvacueeListService: LoadEvacueeListService) {}

constructor(public evacueeSessionService: EvacueeSessionService) {}

ngOnInit(): void {}
ngOnInit(): void {
}

cancel() {
this.outputEvent.emit('close');
Expand All @@ -36,4 +39,13 @@ export class ViewAssessmentDialogComponent implements OnInit {
(ins) => ins.value === incomingValue
)?.name;
}

public getIdentifiedNeeds(): string[] {
return Array.from(this.evacueeSessionService?.currentNeedsAssessment?.needs ?? []).map(
(need) =>
this.loadEvacueeListService
?.getIdentifiedNeeds()
?.find((value) => value.value === need)?.description
);
}
}

0 comments on commit bbd04e7

Please sign in to comment.