Skip to content

Commit

Permalink
[CCAP-518] - registration convictions screen (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
analoo authored Jan 3, 2025
1 parent d7d2c64 commit dc5c65d
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 26 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/ilgcc/app/inputs/Providerresponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,6 @@ public class Providerresponse extends FlowInputs {
private String providerIdentityCheckSSN;

private String providerType;

private String providerConviction;
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private Map<String, SubmissionField> prepareProviderResponse(Submission submissi
"providerResponseBusinessName",
"providerResponseContactPhoneNumber",
"providerResponseContactEmail",
"providerIdentityCheckSSN"
"providerIdentityCheckSSN",
"providerConviction"
);

Submission providerSubmission = providerSubmissionFromId(submission).get();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.ilgcc.app.submission.conditions;

import formflow.library.data.Submission;
import org.springframework.stereotype.Component;

@Component
public class ProviderHasConviction extends BasicCondition {

@Override
public Boolean run(Submission submission) {
return run(submission, "providerConviction", "true");
}
}
2 changes: 2 additions & 0 deletions src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ flow:
condition: EnableProviderRegistration
nextScreens:
- name: registration-convictions-info
condition: ProviderHasConviction
- name: registration-household-members
registration-convictions-info:
condition: EnableProviderRegistration
nextScreens:
Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,13 @@ registration-checks-trainings-notice.accordion.body2.ul1=You may need to do trai
registration-checks-trainings-notice.accordion.body2.li1=CPR and first aid
registration-checks-trainings-notice.accordion.body2.li2=Annual health and safety
registration-checks-trainings-notice.accordion.body2.li3=Child abuse and neglect

# registration-convictions
registration-convictions.title=Past convictions
=======
registration-convictions.header=Have you ever been convicted of anything other than a minor traffic violation?
registration-convictions.subtext=We're sorry to ask about this sensitive subject. This information is required to help decide if you are eligible to be a CCAP child provider.

# registration-convictions-info
registration-convictions-info.title=Past conviction details

# registration-household-members
registration-household-members.title=Household people
1 change: 1 addition & 0 deletions src/main/resources/pdf-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ inputFields:
providerLicenseNumber: PROVIDER_LICENSE_NUMBER
providerType: PROVIDER_TYPE
providerIdentityCheckSSN: PROVIDER_SSN
providerConviction: PROVIDER_CONVICTION
providerSignature: PROVIDER_SIGNATURE
providerSignatureDate: PROVIDER_SIGNATURE_DATE
clientResponseConfirmationCode: APPLICATION_CONFIRMATION_CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head :: head(title='TEMPLATE')}"></head>
<head th:replace="~{fragments/head :: head(title=#{registration-convictions-info.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=#{placeholder}, subtext=#{placeholder})}"/>
<th:block th:replace="~{fragments/cardHeader :: cardHeader(header='placeholder', subtext='placeholder')}"/>
<th:block th:replace="~{fragments/form :: form(action=${formAction}, content=~{::formContent})}">
<th:block th:ref="formContent">
<div class="form-card__content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
<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='placeholder', subtext='placeholder')}"/>
<th:block th:replace="~{fragments/gcc-icons :: person}"></th:block>
<th:block
th:replace="~{fragments/cardHeaderForSingleInputScreen ::
cardHeaderForSingleInputScreen(header=#{registration-convictions.header}, subtext=#{registration-convictions.subtext}, required='true')}"/>
<th:block th:replace="~{fragments/form :: form(action=${formAction}, content=~{::formContent})}">
<th:block th:ref="formContent">
<div class="form-card__content">
<!-- Put inputs here -->
</div>
<div class="form-card__footer">
<th:block th:replace="~{fragments/inputs/submitButton :: submitButton(text=#{general.inputs.continue})}"/>
<th:block th:replace="~{fragments/inputs/yesOrNo :: yesOrNo(
inputName='providerConviction',
ariaDescribe='header')}"/>
</div>
</th:block>
</th:block>
Expand All @@ -25,4 +27,6 @@
</div>
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
</html>

cfa:ye
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head :: head(title='TEMPLATE')}"></head>
<head th:replace="~{fragments/head :: head(title=#{registration-household-members.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=#{placeholder}, subtext=#{placeholder})}"/>
<th:block th:replace="~{fragments/cardHeader :: cardHeader(header='placeholder', subtext='placeholder')}"/>
<th:block th:replace="~{fragments/form :: form(action=${formAction}, content=~{::formContent})}">
<th:block th:ref="formContent">
<div class="form-card__content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ void LicenseExemptInProviderHomeFlow() {
testPage.clickContinue();
// registration-home-provider-dob


// registration-checks-trainings-intro
testPage.navigateToFlowScreen("providerresponse/registration-checks-trainings-intro");

Expand All @@ -193,7 +192,10 @@ void LicenseExemptInProviderHomeFlow() {

// registration-convictions
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickContinue();
testPage.clickYes();

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
}

@Test
Expand Down Expand Up @@ -270,7 +272,6 @@ void LicenseExemptInChildHomeFlow() {
testPage.clickContinue();
// registration-home-provider-dob


// registration-checks-trainings-intro
testPage.navigateToFlowScreen("providerresponse/registration-checks-trainings-intro");

Expand All @@ -284,7 +285,10 @@ void LicenseExemptInChildHomeFlow() {

// registration-convictions
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickContinue();
testPage.clickNo();

// Skips registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title"));
}

@Test
Expand Down Expand Up @@ -356,8 +360,6 @@ void LicensedChildCareHomeFlow() {
testPage.clickContinue();
// registration-home-provider-dob



// registration-checks-trainings-intro
testPage.navigateToFlowScreen("providerresponse/registration-checks-trainings-intro");

Expand All @@ -369,7 +371,10 @@ void LicensedChildCareHomeFlow() {

// registration-convictions
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickContinue();
testPage.clickYes();

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
}

@Test
Expand Down Expand Up @@ -435,7 +440,6 @@ void LicensedChildCareCenterFlow() {

// registration-home-provider-dob


// registration-checks-trainings-intro
testPage.navigateToFlowScreen("providerresponse/registration-checks-trainings-intro");

Expand All @@ -447,8 +451,12 @@ void LicensedChildCareCenterFlow() {

// registration-convictions
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickContinue();
testPage.clickNo();

// Skips registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title"));
}

@Test
void LicensedGroupChildCareCenterFlow() {
createAValidLink();
Expand Down Expand Up @@ -518,7 +526,6 @@ void LicensedGroupChildCareCenterFlow() {
testPage.clickContinue();
// registration-home-provider-dob


// registration-checks-trainings-intro
testPage.navigateToFlowScreen("providerresponse/registration-checks-trainings-intro");

Expand All @@ -530,7 +537,10 @@ void LicensedGroupChildCareCenterFlow() {

// registration-convictions
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickContinue();
testPage.clickYes();

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
}

@Test
Expand Down Expand Up @@ -630,7 +640,6 @@ void LicenseExemptChildCareCenter() {

// registration-home-provider-dob


// registration-checks-trainings-intro
testPage.navigateToFlowScreen("providerresponse/registration-checks-trainings-intro");

Expand All @@ -644,7 +653,10 @@ void LicenseExemptChildCareCenter() {

// registration-convictions
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickContinue();
testPage.clickYes();

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
}

private void createAValidLink() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public void setsValidatedAddressWhenSelected() {
.with("providerMailingCity_validated", "Chicago")
.with("providerMailingState_validated", "IL")
.with("providerMailingZipCode_validated", "60115-1234")
.with("providerIdentityCheckSSN", "123-23-2424")
.with("providerConviction", "true")
.build();

submissionRepositoryService.save(providerSubmission);
Expand Down Expand Up @@ -141,6 +143,11 @@ public void setsValidatedAddressWhenSelected() {
assertThat(result.get("providerResponseContactEmail")).isEqualTo(
new SingleField("providerResponseContactEmail", "mail@daycareplace.org", null));

assertThat(result.get("providerIdentityCheckSSN")).isEqualTo(
new SingleField("providerIdentityCheckSSN", "123-23-2424", null));
assertThat(result.get("providerConviction")).isEqualTo(
new SingleField("providerConviction", "true", null));

}

@Test
Expand Down

0 comments on commit dc5c65d

Please sign in to comment.