-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conviction-related sensitive questions
- Loading branch information
Showing
11 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.mdbenefits.app.submission.actions; | ||
|
||
import formflow.library.config.submission.Action; | ||
import formflow.library.data.Submission; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.mdbenefits.app.utils.HouseholdUtilities; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* | ||
*/ | ||
@Component | ||
@Slf4j | ||
public class SetDefaultSensitiveConvictionAnswers implements Action { | ||
public static final String[] SENSITIVE_CONVICTION_QUESTIONS = { | ||
"HasDrugKingpinFelony", | ||
"HasVolumeDrugDealerFelony", | ||
"HasSexualOffenceConviction", | ||
"IsViolatingParole", | ||
"ConvictedForLyingAboutBenefits", | ||
"ConvictedForTradingBenefits", | ||
"IsReceivingBenefitsWithFakeID" | ||
}; | ||
|
||
@Override | ||
public void run(Submission submission) { | ||
Arrays.stream(SENSITIVE_CONVICTION_QUESTIONS).forEach(s -> submission.getInputData().putIfAbsent("noOne" + s + "[]", "true")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
42 changes: 42 additions & 0 deletions
42
src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html th:lang="${#locale.language}"> | ||
<head th:replace="~{fragments/head :: head(title=#{sensitive-conviction-questions.title})}"></head> | ||
<body> | ||
<div class="page-wrapper"> | ||
<div th:replace="~{fragments/toolbar :: toolbar}"></div> | ||
<section class="slab"> | ||
<div class="grid"> | ||
<div th:replace="~{fragments/goBack :: goBackLink}"></div> | ||
<main id="content" role="main" class="form-card spacing-above-35"> | ||
<th:block | ||
th:replace="~{fragments/cardHeader :: cardHeader(header=#{sensitive-conviction-questions.header}, subtext=#{sensitive-conviction-questions.subtext})}"/> | ||
<th:block | ||
th:replace="~{fragments/form :: form(action=${formAction}, content=~{::sensitiveQuestionsContent})}"> | ||
<th:block th:ref="sensitiveQuestionsContent"> | ||
<div class="form-card__content" | ||
th:each="question : ${T(org.mdbenefits.app.submission.actions.SetDefaultSensitiveConvictionAnswers).SENSITIVE_CONVICTION_QUESTIONS}"> | ||
<div th:with="inputName='noOne' + ${question}, label='sensitive-conviction-question-' + ${question}"> | ||
<th:block th:replace="~{fragments/inputs/checkboxFieldset :: | ||
checkboxFieldset(inputName=${inputName}, | ||
label=#{${label}}, | ||
content=~{::checkboxInSetContent})}"> | ||
<th:block th:ref="checkboxInSetContent"> | ||
<th:block | ||
th:replace="~{fragments/inputs/checkboxInSet :: checkboxInSet(inputName=${inputName}, value='true', label=#{sensitive-conviction-question-true})}"/> | ||
</th:block> | ||
</div> | ||
</div> | ||
<div class="form-card__footer"> | ||
<th:block th:replace="~{fragments/inputs/submitButton :: submitButton( | ||
text=#{general.inputs.continue})}"/> | ||
</div> | ||
</th:block> | ||
</th:block> | ||
</th:block> | ||
</main> | ||
</div> | ||
</section> | ||
</div> | ||
<th:block th:replace="~{fragments/footer :: footer}" /> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestionsIntro.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html th:lang="${#locale.language}"> | ||
<head th:replace="~{fragments/head :: head(title=#{sensitive-conviction-questions-intro.title})}"></head> | ||
<body> | ||
<div class="page-wrapper"> | ||
<div th:replace="~{fragments/toolbar :: toolbar}"></div> | ||
<section class="slab"> | ||
<div class="grid"> | ||
<div th:replace="~{fragments/goBack :: goBackLink}"></div> | ||
<main id="content" role="main" class="form-card spacing-above-35"> | ||
<th:block | ||
th:replace="~{fragments/cardHeader :: cardHeader(header=#{sensitive-conviction-questions-intro.header}, subtext=#{sensitive-conviction-questions-intro.subtext})}"/> | ||
<div class="form-card__footer"> | ||
<th:block th:replace="~{fragments/continueButton :: continue}" /> | ||
</div> | ||
</main> | ||
</div> | ||
</section> | ||
</div> | ||
<th:block th:replace="~{fragments/footer :: footer}" /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters