Skip to content

Commit

Permalink
Merge pull request #1986 from TimaQT/features/timaqt/EMBCESSMOD-5066
Browse files Browse the repository at this point in the history
EMBCESSMOD-5066: bug fixes
  • Loading branch information
ytqsl authored Apr 3, 2024
2 parents 97f6639 + d7eabb2 commit f194787
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ export interface PersonDetails {
initials?: null | string;
lastName: string;
preferredName?: null | string;
isPrimaryRegistrant?: boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ export class PetForm {
customValidator
.conditionalValidation(
() => this.addPetIndicator.value,
Validators.required,
Validators.required
)
.bind(customValidator),
customValidator.whitespaceValidator()
.bind(customValidator)
]
]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export class CustomValidationService {
};
}


/**
* Checks an array of controls by name, to see if they all have different values (unless empty)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class EditService {
private formCreationService: FormCreationService,
private needsAssessmentMapping: NeedsAssessmentMappingService,
private evacuationFileDataService: EvacuationFileDataService
) {}
) { }

/**
* Updates the form with latest values
Expand Down Expand Up @@ -68,13 +68,13 @@ export class EditService {
this.needsAssessmentDataService.insurance = form.get('insurance').value;
break;
case 'pets':
this.needsAssessmentDataService.pets = form.get('pets').value;
break;
this.needsAssessmentDataService.pets = form.get('pets').value;
break;
case 'family-information':
this.needsAssessmentDataService.setHouseHoldMembers(
form.get('householdMembers').value
);
break;
this.needsAssessmentDataService.setHouseHoldMembers(
form.get('householdMembers').value
);
break;
case 'identify-needs':
this.needsAssessmentDataService.setNeedsDetails(form);
break;
Expand Down Expand Up @@ -183,9 +183,9 @@ export class EditService {
form.reset();
}
break;
case 'family-information-pets':
case 'family-information':
if (
this.needsAssessmentDataService.householdMembers.length !== 0 ) {
this.needsAssessmentDataService.householdMembers.length !== 0) {
if (path === 'verified-registration') {
form
.get('householdMembers')
Expand All @@ -209,7 +209,7 @@ export class EditService {
break;
case 'pets':
if (
this.needsAssessmentDataService.pets.length !== 0
this.needsAssessmentDataService.pets?.length !== 0
) {
form.get('pets').patchValue(this.needsAssessmentDataService.pets);
} else {
Expand All @@ -219,14 +219,14 @@ export class EditService {
case 'identify-needs':
if (
this.needsAssessmentDataService.canEvacueeProvideClothing !==
undefined &&
undefined &&
this.needsAssessmentDataService.canEvacueeProvideFood !== undefined &&
this.needsAssessmentDataService.canEvacueeProvideIncidentals !==
undefined &&
undefined &&
this.needsAssessmentDataService.canEvacueeProvideLodging !==
undefined &&
undefined &&
this.needsAssessmentDataService.canEvacueeProvideTransportation !==
undefined
undefined
) {
form
.get('canEvacueeProvideClothing')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class NeedsAssessmentService {
return [...this.householdMembers, primaryMember];
} else if (
!this.householdMembers.find(
(member) => member.details.isPrimaryRegistrant === true
(member) => member.isPrimaryRegistrant === true
)
) {
return [...this.householdMembers, primaryMember];
Expand Down

0 comments on commit f194787

Please sign in to comment.