Skip to content

Commit

Permalink
just cleaned up code a bit and made names more intuitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Ana Medrano Fernandez authored and Ana Medrano Fernandez committed Oct 11, 2023
1 parent 3aeb0af commit e05d290
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public class LaDigitalAssister extends FlowInputs {

// Sensitive Questions
private String householdHasPersonalSituations;
private String uuidsByPersonalSituations;
private String personalSituationsHouseholdUUID;
private List<String> 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;
}

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -14,7 +13,7 @@
*/
@Component
@Slf4j
public class ReformatsUserDataBeforeDisplaying implements Action {
public class ReformatPersonalSituationUserData implements Action {

@Override
public void run(Submission submission) {
Expand All @@ -25,7 +24,7 @@ public void run(Submission submission) {

private ArrayList<LinkedHashMap> reformatPersonalSituations(Map<String, Object> inputData) {
ArrayList<LinkedHashMap> householdMembers = (ArrayList) inputData.get("household");
ArrayList<String> hasPersonalSituations = (ArrayList) inputData.get("uuidsByPersonalSituations[]");
ArrayList<String> hasPersonalSituations = (ArrayList) inputData.get("personalSituationsHouseholdUUID[]");
ArrayList<LinkedHashMap> personalSituationsObject = new ArrayList<>();

hasPersonalSituations.forEach((String id) -> {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ flow:
condition: HouseholdHasPersonalSituations
- name: householdVictimOfDomesticViolence
householdPersonalSituationsWho:
beforeSaveAction: ReformatsUserDataBeforeDisplaying
beforeSaveAction: ReformatPersonalSituationUserData
nextScreens:
- name: householdWhichPersonalSituations
householdWhichPersonalSituations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<th:block th:ref="formContents">
<div class="form-card__content">
<th:block th:replace="~{'fragments/inputs/householdCheckboxFieldset' ::
householdCheckboxFieldset(inputName='uuidsByPersonalSituations')}"/>
householdCheckboxFieldset(inputName='personalSituationsHouseholdUUID')}"/>
</div>
<div class="form-card__footer">
<th:block th:replace="~{fragments/inputs/submitButton :: submitButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
<h2 th:text="#{personal-situations-which.subheader(${individual.firstName})}"></h2>
<p th:text="#{general.check-all-that-apply}"></p>
<th:block
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='homelessSwitch',value=${individual.uuid}, label=#{personal-situations.which.option1})}"/>
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationHomelessSwitch',value=${individual.uuid}, label=#{personal-situations.which.option1})}"/>
<th:block
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='strugglingDrugsAlcohol',value=${individual.uuid}, label=#{personal-situations.which.option2})}"/>
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationStrugglingDrugsAlcohol',value=${individual.uuid}, label=#{personal-situations.which.option2})}"/>
<th:block
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='domesticViolenceFlag',value=${individual.uuid}, label=#{personal-situations.which.option3})}"/>
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationDomesticViolenceFlag',value=${individual.uuid}, label=#{personal-situations.which.option3})}"/>
<th:block
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personaIssueDisability',value=${individual.uuid}, label=#{personal-situations.which.option4})}"/>
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationDisability',value=${individual.uuid}, label=#{personal-situations.which.option4})}"/>
<th:block
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='otherIssue',value=${individual.uuid}, label=#{personal-situations.which.option5}, helptext=#{personal-situations.other.helptext})}"/>
th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationOtherIssue',value=${individual.uuid}, label=#{personal-situations.which.option5}, helptext=#{personal-situations.other.helptext})}"/>
</th:block>
</th:block>
</div>
Expand Down

0 comments on commit e05d290

Please sign in to comment.