From 716444e02dada1f810f73bd8524d925cee4cc335 Mon Sep 17 00:00:00 2001 From: Vraj Mohan Date: Tue, 13 Feb 2024 16:32:16 -0800 Subject: [PATCH] Switch to radio buttons and update wording --- .../mdbenefits/app/inputs/MdBenefitsFlow.java | 14 ++++---- .../preparers/ApplicantDetailsPreparer.java | 14 -------- .../SetDefaultSensitiveConvictionAnswers.java | 2 +- src/main/resources/messages.properties | 27 +++++++++------ src/main/resources/pdf-map.yaml | 11 ++---- .../inputs/radioFieldsetUnescaped.html | 34 +++++++++++++++++++ .../sensitiveConvictionQuestions.html | 18 ++++++---- .../journeys/MdBenefitsFlowJourneyTest.java | 15 +++++--- .../mdbenefits/app/pdf/PdfServiceTest.java | 4 +-- 9 files changed, 85 insertions(+), 54 deletions(-) create mode 100644 src/main/resources/templates/fragments/inputs/radioFieldsetUnescaped.html diff --git a/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java b/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java index 1bb7976a..87439f72 100644 --- a/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java +++ b/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java @@ -415,13 +415,13 @@ public class MdBenefitsFlow extends FlowInputs { @DynamicField private String docType; - private List noOneHasDrugKingpinFelony; - private List noOneHasVolumeDrugDealerFelony; - private List noOneHasSexualOffenceConviction; - private List noOneIsViolatingParole; - private List noOneConvictedForLyingAboutBenefits; - private List noOneConvictedForTradingBenefits; - private List noOneIsReceivingBenefitsWithFakeID; + private String someoneHasDrugKingpinFelony; + private String someoneHasVolumeDrugDealerFelony; + private String someoneHasSexualOffenceConviction; + private String someoneIsViolatingParole; + private String someoneConvictedForLyingAboutBenefits; + private String someoneConvictedForTradingBenefits; + private String someoneIsReceivingBenefitsWithFakeID; @NotEmpty(message = "{error.must-accept-terms}") private List tcaAcknowledgementAgree; diff --git a/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java b/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java index fa77ff13..6ee88bc8 100644 --- a/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java +++ b/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java @@ -37,25 +37,11 @@ public Map prepareSubmissionFields(Submission submissio new SingleField("applicantSSN", SubmissionUtilities.formatSSN((String) inputData.get("encryptedSSN")), null)); results.put("speaksEnglish", new SingleField("speaksEnglish", (String) "Yes", null)); - prepareAnswersToSensitiveQuestions(inputData, results); // TODO - this will get finished when design says it's ready //prepareCitizenshipStatus(inputData, results); return results; } - private void prepareAnswersToSensitiveQuestions(Map inputData, Map results) { - for (String question : SubmissionUtilities.SENSITIVE_CONVICTION_QUESTIONS) { - String yesField = "noOne" + question; - String noField = "someone" + question; - List response = (List) inputData.get(yesField + "[]"); - if (response != null && response.contains("true")) { - results.put(yesField, new SingleField(yesField, "Yes", null)); - } else { - results.put(noField, new SingleField(noField, "Yes", null)); - } - } - } - private void prepareCitizenshipStatus(Map inputData, Map results) { boolean allAreCitizens = ((String) inputData.get("allAreCitizens")).equalsIgnoreCase("yes"); boolean applyingForSelf = ((String) inputData.get("isApplicantApplying")).equalsIgnoreCase("yes"); diff --git a/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java b/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java index fd24236b..c6c00a2e 100644 --- a/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java +++ b/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java @@ -16,6 +16,6 @@ public class SetDefaultSensitiveConvictionAnswers implements Action { @Override public void run(Submission submission) { - Arrays.stream(SubmissionUtilities.SENSITIVE_CONVICTION_QUESTIONS).forEach(s -> submission.getInputData().putIfAbsent("noOne" + s + "[]", "true")); + Arrays.stream(SubmissionUtilities.SENSITIVE_CONVICTION_QUESTIONS).forEach(s -> submission.getInputData().putIfAbsent("someone" + s, "false")); } } diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 1e6d16e5..1ee17d06 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -917,16 +917,23 @@ legal-stuff.answer-legal-question=Answer legal questions legal-stuff.review-legal-agreements=Review legal agreements legal-stuff.sign-and-submit=Sign and submit sensitive-conviction-questions.title=Sensitive Questions -sensitive-conviction-questions.header=Please check what is true for you and everyone in your household -sensitive-conviction-questions.subtext=If any statements are not true, you can talk to a case worker after submitting your application to see who is able to get benefits. -sensitive-conviction-question-HasDrugKingpinFelony=No one has been convicted of a felony that involved conspiring to supervise, organize, finance, or manage the making, transporting, or selling of controlled substances in the State on or after August 22, 1996. -sensitive-conviction-question-HasVolumeDrugDealerFelony=No one has been convicted of a felony that involved making, distributing, dispensing, or possessing controlled substances on or after August 22, 1996. -sensitive-conviction-question-HasSexualOffenceConviction=

No one has been convicted after February 7, 2014 of aggravated sexual abuse, murder, sexual exploitation and other abuse of children, sexual assault* and is also not in compliance with the terms of their sentence?

*as defined in the Violence Against Women Act of 1994, or a similar state law.

-sensitive-conviction-question-IsViolatingParole=No one is violating parole, probation or fleeing from police or the courts. -sensitive-conviction-question-ConvictedForLyingAboutBenefits=Since August 22, 1996, no one has been convicted in courts of lying about where they lived or their identity in order to receive food benefits or cash assistance from multiple places in the same month. -sensitive-conviction-question-ConvictedForTradingBenefits=No one has been convicted in a court for trafficking $500 or more of food benefits. -sensitive-conviction-question-IsReceivingBenefitsWithFakeID=No one is getting food or cash benefits under a different identity or as a member of another household in another State. -sensitive-conviction-question-true=True +sensitive-conviction-questions.header=Please answer the following questions for you and everyone in your household +sensitive-conviction-questions.subtext=

If any of the following are "yes" for a member of your household, they may not be allowed to receive TCA or SNAP. However, they may still be eligible. After submitting your application, you can talk to a caseworker to see who can get benefits.

\ +

It's essential to be honest so you and your household get the benefits you're entitled to. There are also penalties for providing false information.

+ +sensitive-conviction-question-HasDrugKingpinFelony=

Has anyone in your household been convicted of a drug kingpin felony on or after August 22, 1996?

\ +

A drug kingpin is an organizer, supervisor, financier, or manager who acts as a co-conspirator in a conspiracy to manufacture, distribute, dispense, transport in, or bring into the State a controlled dangerous substance.

+sensitive-conviction-question-HasVolumeDrugDealerFelony=

Has anyone in your household been convicted of a volume dealer drug felony on or after August 22, 1996?

\ +

A volume dealer is an individual, who manufactures, distributes, dispenses or possesses certain quantities of a controlled dangerous substance.

+sensitive-conviction-question-HasSexualOffenceConviction=

Has anyone in your household been convicted after February 7, 2014 of aggravated sexual abuse, murder, sexual exploitation and other abuse of children, sexual assault*, or a similar state law, and is also not in compliance with the terms of their sentence?

\ +

*as defined in the Violence Against Women Act of 1994, or a similar state law.

+sensitive-conviction-question-IsViolatingParole=Is anyone in your household currently violating parole or probation or fleeing from the police or the courts? +sensitive-conviction-question-ConvictedForLyingAboutBenefits=Has anyone in your household been convicted since August 22, 1996 in a federal or state court for not telling the truth about where they lived or their identity in order to receive food supplement benefits or cash assistance from more than one place in the same month? +sensitive-conviction-question-ConvictedForTradingBenefits=Has a court convicted any member of your household for trading or trafficking SNAP benefits of $500 or more? +sensitive-conviction-question-IsReceivingBenefitsWithFakeID=Is anyone in your household receiving benefits under another identity or as a member of another household or in another State? +sensitive-conviction-question-yes=Yes +sensitive-conviction-question-no=No + sensitive-conviction-questions-intro.title=Sensitive Questions Intro sensitive-conviction-questions-intro.header=Sensitive questions sensitive-conviction-questions-intro.subtext=We need to ask you questions that may be sensitive. diff --git a/src/main/resources/pdf-map.yaml b/src/main/resources/pdf-map.yaml index b50fc72e..27472887 100644 --- a/src/main/resources/pdf-map.yaml +++ b/src/main/resources/pdf-map.yaml @@ -25,24 +25,17 @@ inputFields: mailingAddress: mailingAddress signature: signature sex: applicantSex - isApplicantApplying: isApplicantApplying citizenshipStatus: isApplicantCitizen - + someoneInHHIsPregnant: someoneInHHIsPregnant + someoneHasDrugKingpinFelony: someoneHasDrugKingpinFelony - noOneHasDrugKingpinFelony: noOneHasDrugKingpinFelony someoneHasVolumeDrugDealerFelony: someoneHasVolumeDrugDealerFelony - noOneHasVolumeDrugDealerFelony: noOneHasVolumeDrugDealerFelony someoneHasSexualOffenceConviction: someoneHasSexualOffenceConviction - noOneHasSexualOffenceConviction: noOneHasSexualOffenceConviction someoneIsViolatingParole: someoneIsViolatingParole - noOneIsViolatingParole: noOneIsViolatingParole someoneConvictedForLyingAboutBenefits: someoneConvictedForLyingAboutBenefits - noOneConvictedForLyingAboutBenefits: noOneConvictedForLyingAboutBenefits someoneConvictedForTradingBenefits: someoneConvictedForTradingBenefits - noOneConvictedForTradingBenefits: noOneConvictedForTradingBenefits someoneIsReceivingBenefitsWithFakeID: someoneIsReceivingBenefitsWithFakeID - noOneIsReceivingBenefitsWithFakeID: noOneIsReceivingBenefitsWithFakeID # Vraj - Usable to here diff --git a/src/main/resources/templates/fragments/inputs/radioFieldsetUnescaped.html b/src/main/resources/templates/fragments/inputs/radioFieldsetUnescaped.html new file mode 100644 index 00000000..284b8e08 --- /dev/null +++ b/src/main/resources/templates/fragments/inputs/radioFieldsetUnescaped.html @@ -0,0 +1,34 @@ + +
+
+ + [(${label})] +

+
+ + +
+ +
+
diff --git a/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html b/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html index ff665b90..6d02079c 100644 --- a/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html +++ b/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html @@ -15,15 +15,19 @@
-
- - +
+ + + th:replace="~{fragments/inputs/radio :: radio(inputName=${inputName},value='false', label=#{sensitive-conviction-question-no})}"/> + + +