From e05d290fee34cf5e966323efb2f6e291d7ad91cc Mon Sep 17 00:00:00 2001 From: Ana Medrano Fernandez Date: Wed, 11 Oct 2023 13:22:54 -0700 Subject: [PATCH] just cleaned up code a bit and made names more intuitive --- .../ladocuploader/app/inputs/LaDigitalAssister.java | 12 ++++++------ ...g.java => ReformatPersonalSituationUserData.java} | 5 ++--- src/main/resources/flows-config.yaml | 2 +- .../householdPersonalSituationsWho.html | 2 +- .../householdWhichPersonalSituations.html | 10 +++++----- 5 files changed, 15 insertions(+), 16 deletions(-) rename src/main/java/org/ladocuploader/app/submission/actions/{ReformatsUserDataBeforeDisplaying.java => ReformatPersonalSituationUserData.java} (93%) diff --git a/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java b/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java index f440466b0..709561a0c 100644 --- a/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java +++ b/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java @@ -73,14 +73,14 @@ public class LaDigitalAssister extends FlowInputs { // Sensitive Questions private String householdHasPersonalSituations; - private String uuidsByPersonalSituations; + private String personalSituationsHouseholdUUID; private List personalSituationsListed; private String householdHasDomesticViolenceSituation; private String householdHasCriminalJusticeSituation; - private String homelessSwitch; - private String otherIssue; - private String strugglingDrugsAlcohol; - private String domesticViolenceFlag; - private String personaIssueDisability; + private String personalSituationHomelessSwitch; + private String personalSituationOtherIssue; + private String personalSituationStrugglingDrugsAlcohol; + private String personalSituationDomesticViolenceFlag; + private String personalSituationDisability; } diff --git a/src/main/java/org/ladocuploader/app/submission/actions/ReformatsUserDataBeforeDisplaying.java b/src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java similarity index 93% rename from src/main/java/org/ladocuploader/app/submission/actions/ReformatsUserDataBeforeDisplaying.java rename to src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java index ef1aac1ba..a6b7abaa4 100644 --- a/src/main/java/org/ladocuploader/app/submission/actions/ReformatsUserDataBeforeDisplaying.java +++ b/src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java @@ -3,7 +3,6 @@ import formflow.library.config.submission.Action; import formflow.library.data.Submission; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import lombok.extern.slf4j.Slf4j; @@ -14,7 +13,7 @@ */ @Component @Slf4j -public class ReformatsUserDataBeforeDisplaying implements Action { +public class ReformatPersonalSituationUserData implements Action { @Override public void run(Submission submission) { @@ -25,7 +24,7 @@ public void run(Submission submission) { private ArrayList reformatPersonalSituations(Map inputData) { ArrayList householdMembers = (ArrayList) inputData.get("household"); - ArrayList hasPersonalSituations = (ArrayList) inputData.get("uuidsByPersonalSituations[]"); + ArrayList hasPersonalSituations = (ArrayList) inputData.get("personalSituationsHouseholdUUID[]"); ArrayList personalSituationsObject = new ArrayList<>(); hasPersonalSituations.forEach((String id) -> { diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml index 0561e3a44..74645928f 100644 --- a/src/main/resources/flows-config.yaml +++ b/src/main/resources/flows-config.yaml @@ -173,7 +173,7 @@ flow: condition: HouseholdHasPersonalSituations - name: householdVictimOfDomesticViolence householdPersonalSituationsWho: - beforeSaveAction: ReformatsUserDataBeforeDisplaying + beforeSaveAction: ReformatPersonalSituationUserData nextScreens: - name: householdWhichPersonalSituations householdWhichPersonalSituations: diff --git a/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html b/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html index a5ee47ad2..631baa711 100644 --- a/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html +++ b/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html @@ -15,7 +15,7 @@
+ householdCheckboxFieldset(inputName='personalSituationsHouseholdUUID')}"/>