Skip to content

Commit

Permalink
Removed 2 questions regarding pets
Browse files Browse the repository at this point in the history
  • Loading branch information
TimA authored and TimA committed Mar 13, 2024
1 parent bcdb5f5 commit 3e871dc
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,10 @@ public class NeedsAssessment
[Required]
public InsuranceOption Insurance { get; set; }

public string? PetCarePlans { get; set; }

[Required]
public IEnumerable<EvacuationFileHouseholdMember> HouseholdMembers { get; set; } = Array.Empty<EvacuationFileHouseholdMember>();

public IEnumerable<Pet> Pets { get; set; } = Array.Empty<Pet>();
public bool? HavePetsFood { get; set; }
public bool? CanProvideFood { get; set; }
public bool? CanProvideLodging { get; set; }
public bool? CanProvideClothing { get; set; }
Expand Down Expand Up @@ -406,10 +403,7 @@ public class Note
public enum NoteType
{
[Description("General")]
General,

[Description("Pet Care Plans")]
PetCarePlans
General
}

/// <summary>
Expand Down Expand Up @@ -547,7 +541,6 @@ public EvacuationFileMapping()
.ForMember(d => d.ModifiedOn, opts => opts.MapFrom(s => s.CompletedOn))
.ForMember(d => d.ReviewingTeamMemberId, opts => opts.MapFrom(s => s.CompletedBy == null ? null : s.CompletedBy.Id))
.ForMember(d => d.ReviewingTeamMemberDisplayName, opts => opts.MapFrom(s => s.CompletedBy == null ? null : s.CompletedBy.DisplayName))
.ForMember(d => d.PetCarePlans, opts => opts.MapFrom(s => s.Notes.SingleOrDefaultProperty(n => n.Type == EMBC.ESS.Shared.Contracts.Events.NoteType.PetCarePlans, n => n.Content)))
;

CreateMap<EvacuationFileHouseholdMember, HouseholdMember>()
Expand Down Expand Up @@ -592,15 +585,6 @@ public class NeedsAssessmentNotesConverter : IValueConverter<NeedsAssessment, IE
{
List<EMBC.ESS.Shared.Contracts.Events.Note> ret = new List<EMBC.ESS.Shared.Contracts.Events.Note>();

if (!string.IsNullOrEmpty(sourceMember.PetCarePlans))
{
ret.Add(new EMBC.ESS.Shared.Contracts.Events.Note
{
Content = sourceMember.PetCarePlans,
Type = EMBC.ESS.Shared.Contracts.Events.NoteType.PetCarePlans,
});
}

return ret;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ private static NeedsAssessment CreateNeedsAssessment()
.RuleFor(o => o.CanProvideIncidentals, f => f.Random.NullableBool())
.RuleFor(o => o.CanProvideLodging, f => f.Random.NullableBool())
.RuleFor(o => o.CanProvideTransportation, f => f.Random.NullableBool())
.RuleFor(o => o.HavePetsFood, f => f.Random.NullableBool())
.RuleFor(o => o.Insurance, f => f.Random.Enum<InsuranceOption>())
.RuleFor(o => o.Type, f => f.Random.Enum<NeedsAssessmentType>())
.RuleFor(o => o.Notes, f => f.Make(f.Random.Int(0, 20), CreateNote))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,6 @@
</mat-table>
</div>
</div>

<div class="row" *ngIf="essFile?.needsAssessment?.pets?.length > 0">
<div class="col-md-4">Sufficient pet food?</div>
<div class="col-md-8 bold">
{{ essFile?.needsAssessment?.havePetsFood ? 'Yes' : 'No' }}
</div>
</div>

<div class="row" *ngIf="essFile?.needsAssessment?.pets?.length > 0">
<div class="col-md-4">Pet Care Plan</div>
<div class="col-md-8 bold">
{{ essFile?.needsAssessment?.petCarePlans }}
</div>
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe('EssFileDetailsComponent', () => {
reviewingTeamMemberId: '8d955446-de73-ec11-b830-00505683fbf4',
reviewingTeamMemberDisplayName: 'ESS D.',
insurance: InsuranceOption.Unsure,
petCarePlans: null,
householdMembers: [
{
id: '42ab5087-ce1c-48ec-b339-1b1c173842d7',
Expand Down Expand Up @@ -97,7 +96,6 @@ describe('EssFileDetailsComponent', () => {
}
],
pets: [],
havePetsFood: false,
canProvideFood: false,
canProvideLodging: true,
canProvideClothing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<div class="container container-frame">

<div class="row">
<div class="col-12 content-container">
<form [formGroup]="animalsForm">
Expand Down Expand Up @@ -142,59 +140,6 @@
</div>
</div>
</div>

<div *ngIf="petSource.getValue().length > 0" class="card-align">
<div class="row">
<div class="col-md-12">
<label
id="hasPetsFood-radio-group-label"
class="no-margin requiredField"
>
Do you have sufficient food for your pet(s)?
</label>

<mat-radio-group
aria-labelledby="hasPetsFood-radio-group-label"
formControlName="hasPetsFood"
class="primary-radio-group"
>
<mat-radio-button
class="primary-radio-button"
*ngFor="let option of radioOption"
[value]="option.value"
>
{{ option.name }}
</mat-radio-button>
<mat-error
class="custom-mat-error"
*ngIf="
animalsFormControl?.hasPetsFood.touched &&
animalsFormControl?.hasPetsFood.invalid &&
animalsFormControl?.hasPetsFood.hasError('required')
"
>
Pet food is required</mat-error
>
</mat-radio-group>

<hr class="break-margin" />

<label class="no-margin">
What is your pet care plan for the duration of the evacuation?
</label>

<mat-form-field appearance="outline">
<textarea
rows="10"
formControlName="petCareDetails"
placeholder="Please write in the evacuee's own words as much as possible."
maxlength="4000"
matInput
></textarea>
</mat-form-field>
</div>
</div>
</div>
</form>


Expand Down Expand Up @@ -241,4 +186,4 @@
</div>
</div>
</div>
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class AnimalsComponent implements OnInit, OnDestroy {

// Update Value and Validity for pets form if hasPets changes
this.animalsForm.get('hasPets').valueChanges.subscribe(() => {
this.animalsForm.get('hasPetsFood').updateValueAndValidity();

this.animalsForm.get('pets').updateValueAndValidity();
this.ValidPetsIndicator.emit(this.animalsForm.valid);
Expand Down Expand Up @@ -107,8 +106,6 @@ export class AnimalsComponent implements OnInit, OnDestroy {
this.pets = [];
this.petSource.next(this.pets);
this.animalsForm.get('pets').setValue(this.pets);
this.animalsForm.get('hasPetsFood').reset();
this.animalsForm.get('petCareDetails').reset();
} else {
this.animalsForm.get('hasPets').setValue('Yes');
}
Expand Down Expand Up @@ -186,8 +183,6 @@ export class AnimalsComponent implements OnInit, OnDestroy {
this.animalsForm.get('addPetIndicator').setValue(false);

if (this.pets.length === 0) {
this.animalsForm.get('hasPetsFood').reset();
this.animalsForm.get('petCareDetails').reset();
this.animalsForm.get('hasPets').setValue('No');
}
}
Expand Down Expand Up @@ -251,16 +246,6 @@ export class AnimalsComponent implements OnInit, OnDestroy {
)
.bind(this.customValidation)
],
hasPetsFood: [
this.stepEssFileService.havePetsFood,
this.customValidation
.conditionalValidation(
() => this.animalsForm.get('hasPets').value === 'Yes',
Validators.required
)
.bind(this.customValidation)
],
petCareDetails: [this.stepEssFileService.petCarePlans],
pet: this.createPetForm(),
addPetIndicator: [false]
});
Expand Down Expand Up @@ -334,10 +319,6 @@ export class AnimalsComponent implements OnInit, OnDestroy {
private saveFormData() {
this.stepEssFileService.havePets = this.animalsForm.get('hasPets').value;
this.stepEssFileService.petsList = this.animalsForm.get('pets').value;
this.stepEssFileService.havePetsFood =
this.animalsForm.get('hasPetsFood').value;
this.stepEssFileService.petCarePlans =
this.animalsForm.get('petCareDetails').value;
this.stepEssFileService.addPetIndicator =
this.animalsForm.get('addPetIndicator').value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div class="row">
<div class="col-12">
<div class="review-panel data-panel">
<label class="tab-subtitle">Household Members & Pets</label>
<label class="tab-subtitle">Household Members</label>

<div class="row">
<div class="col-8">
Expand Down Expand Up @@ -229,7 +229,7 @@
<div class="row">
<div class="col-4">Pets?</div>
<div class="col-8 bold">
{{ stepEssFileService?.havePets }}
{{ stepEssFileService?.havePets ? stepEssFileService?.havePets : "No" }}
</div>
</div>

Expand Down Expand Up @@ -269,20 +269,6 @@
</mat-table>
</div>
</div>

<div class="row" *ngIf="stepEssFileService?.petsList?.length > 0">
<div class="col-4">Sufficient pet food?</div>
<div class="col-8 bold">
{{ stepEssFileService?.havePetsFood }}
</div>
</div>

<div class="row" *ngIf="stepEssFileService?.petsList?.length > 0">
<div class="col-4">Pet Care Plan</div>
<div class="col-8 bold">
{{ stepEssFileService?.petCarePlans }}
</div>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<div class="container container-frame">
<div class="heading-container">
<div class="row">
<div class="col-md-12">
<span class="wizard-tab-heading">Household Members & Pets</span>
</div>
</div>
</div>


<app-household-members (ValidHouseholdMemebersIndicator)="ValidHouseholdMemebersIndicator($event)"></app-household-members>
<app-animals (ValidPetsIndicator)="ValidPetsIndicator($event)"></app-animals>

Expand All @@ -15,4 +24,4 @@
</button>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { WizardService } from "../../wizard.service";

export class HouseholdMembersPetsComponent implements OnInit {


petsValid = true;
householdMembersValid = true;
tabMetaData: TabModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<div class="container container-frame">
<div class="heading-container">
<div class="row">
<div class="col-md-12">
<span class="wizard-tab-heading">Household Members & Pets</span>
</div>
</div>
</div>

<div class="row">
<div class="col-12 content-container">
Expand Down Expand Up @@ -377,4 +369,4 @@

</div>
</div>
</div>

Loading

0 comments on commit 3e871dc

Please sign in to comment.