Skip to content

Commit

Permalink
[CCAP-519] - registration convictions info screen (#979)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc P <mperlman@codeforamerica.org>
  • Loading branch information
analoo and cram-cfa authored Jan 6, 2025
1 parent e675c26 commit 98b38e6
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 71 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/ilgcc/app/inputs/Providerresponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public class Providerresponse extends FlowInputs {

private String providerConviction;

@NotBlank(message = "{registration-convictions-info.error}")
private String providerConvictionExplanation;

private String providerHouseholdLiveWithOthers;

private String providerIdentityCheckDateOfBirthDay;
private String providerIdentityCheckDateOfBirthMonth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private Map<String, SubmissionField> prepareProviderResponse(Submission submissi
"providerResponseContactEmail",
"providerIdentityCheckSSN",
"providerConviction",
"providerConvictionExplanation",
"providerIdentityCheckDateOfBirthDate"
);

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 HasRegistrationHouseholdMembers extends BasicCondition {

@Override
public Boolean run(Submission submission) {
return run(submission, "providerHouseholdLiveWithOthers", "true");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.ilgcc.app.submission.conditions;

import formflow.library.config.submission.Condition;
import formflow.library.data.Submission;
import java.util.List;
import org.ilgcc.app.utils.enums.ProviderType;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ProviderHouseholdRegistrationRequired implements Condition {

final static List providerTypesRequired = List.of(
ProviderType.LICENSE_EXEMPT_RELATIVE_IN_PROVIDER_HOME.name(),
ProviderType.LICENSE_EXEMPT_NONRELATIVE_IN_PROVIDER_HOME.name()
);

@Value("${il-gcc.allow-provider-registration-flow}")
private boolean enableProviderRegistration;

@Override
public Boolean run(Submission submission) {
return enableProviderRegistration && displayScreen(submission);
}

private Boolean displayScreen(Submission submission) {
String providerType = (String) submission.getInputData().getOrDefault("providerType", "");
return providerTypesRequired.contains(providerType);
}
}
17 changes: 10 additions & 7 deletions src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,6 @@ flow:
condition: EnableProviderRegistration
nextScreens:
- name: registration-getting-started
registration-family-response-intro:
condition: EnableProviderRegistration
nextScreens:
- name: confirmation-code
registration-getting-started:
condition: EnableProviderRegistration
nextScreens:
Expand Down Expand Up @@ -718,16 +714,23 @@ flow:
nextScreens:
- name: registration-household-members
registration-household-members:
condition: EnableProviderRegistration
condition: ProviderHouseholdRegistrationRequired
nextScreens:
- name: registration-household-add-person
condition: HasRegistrationHouseholdMembers
- name: registration-family-response-intro
registration-household-add-person:
condition: EnableProviderRegistration
condition: ProviderHouseholdRegistrationRequired
nextScreens:
- name: registration-household-add-person-info
registration-household-add-person-info:
condition: ProviderHouseholdRegistrationRequired
nextScreens:
- name: submit-complete-final
- name: registration-family-response-intro
registration-family-response-intro:
condition: EnableProviderRegistration
nextScreens:
- name: confirmation-code
submit-complete-final:
nextScreens:
- name: registration-getting-started
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,18 @@ registration-convictions.subtext=We're sorry to ask about this sensitive subject

# registration-convictions-info
registration-convictions-info.title=Past conviction details
registration-convictions-info.header=Can you explain what you were convicted of?
registration-convictions-info.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.error=Make sure to enter an explanation

# registration-household-members
registration-household-members.title=Household people
registration-household-members.header=Do you live with anyone else?
registration-household-members.subtext=<p>Include both adults and children.</p><ul class="list--bulleted"><li>Anyone over the age of 13 who lives with you will need to complete a background check.</li><li>Any children under the age of 13 who live with you will count towards the maximum number of children you can care for.</li><li>If you don't have a child care license, you can provide care for <strong>up to 3 children (including your own)</strong>.</li></ul>

# registration-household-add-person
registration-household-add-person.title=Add people in your household

# registration-family-response-intro
registration-family-response-intro.title=Respond to a family's application

1 change: 1 addition & 0 deletions src/main/resources/pdf-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ inputFields:
providerType: PROVIDER_TYPE
providerIdentityCheckSSN: PROVIDER_SSN
providerConviction: PROVIDER_CONVICTION
providerConvictionExplanation: PROVIDER_CONVICTION_EXPLANATION
providerIdentityCheckDateOfBirthDate: PROVIDER_DOB
providerSignature: PROVIDER_SIGNATURE
providerSignatureDate: PROVIDER_SIGNATURE_DATE
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/static/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@ p.normal {
background-color: #ffffff;
}

#providerConvictionExplanation {
padding: 15px;
background: white;
box-shadow: 0px 2px 0px #CFC5BF inset;
border: 2px #121111 solid;
font-weight: normal;
resize: none;
}

.notice-container {
max-width: 55rem;
margin-bottom: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org">
<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/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})}"/>
</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
<th:block
th:replace="~{fragments/screens/screenWithOneInput ::
screenWithOneInput(
title=#{registration-convictions-info.title},
header=#{registration-convictions-info.header},
subtext=#{registration-convictions-info.subtext},
required=true,
buttonLabel=#{general.button.continue},
iconFragment=~{fragments/gcc-icons :: person},
formAction=${formAction},
inputContent=~{::inputContent})}">
<th:block th:ref="inputContent">
<th:block th:replace="~{fragments/inputs/textArea ::
textArea(inputName='providerConvictionExplanation',
ariaLabel='header',
rows='2',
maxLength='88')}"/>
</th:block>
</th:block>
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-family-response-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=#{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
@@ -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-add-person.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
@@ -1,28 +1,13 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org">
<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/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})}"/>
</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
<th:block
th:replace="~{fragments/screens/screenWithYesAndNoButtons ::
screenWithYesAndNoButtons(
title=#{registration-household-members.title},
header=#{registration-household-members.header},
subtext=#{registration-household-members.subtext},
formAction=${formAction},
iconFragment=~{fragments/gcc-icons :: householdOtherAdults},
inputName='providerHouseholdLiveWithOthers',
inputContent=~{::inputContent})}">
<th:block th:ref="inputContent">
</th:block>
</th:block>
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,25 @@ void LicenseExemptInProviderHomeFlow() {

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
testPage.enter("providerConvictionExplanation", "Reason for conviction");
testPage.clickContinue();

// registration-household-members
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title"));
testPage.clickNo();

// registration-family-response-intro
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title"));
testPage.goBack();

// registration-household-members
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title"));
testPage.clickYes();

// registration-household-add-person
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-add-person.title"));


}

@Test
Expand Down Expand Up @@ -297,8 +316,9 @@ void LicenseExemptInChildHomeFlow() {
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickNo();

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

@Test
Expand Down Expand Up @@ -385,6 +405,11 @@ void LicensedChildCareHomeFlow() {

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
testPage.enter("providerConvictionExplanation", "Reason for conviction");
testPage.clickContinue();

// registration-family-response-intro
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title"));
}

@Test
Expand Down Expand Up @@ -463,8 +488,8 @@ void LicensedChildCareCenterFlow() {
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title"));
testPage.clickNo();

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

@Test
Expand Down Expand Up @@ -550,6 +575,11 @@ void LicensedGroupChildCareCenterFlow() {

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
testPage.enter("providerConvictionExplanation", "Reason for conviction");
testPage.clickContinue();

// registration-family-response-intro
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title"));
}

@Test
Expand Down Expand Up @@ -666,6 +696,11 @@ void LicenseExemptChildCareCenter() {

// registration-convictions-info
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title"));
testPage.enter("providerConvictionExplanation", "Reason for conviction");
testPage.clickContinue();

// registration-family-response-intro
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title"));
}

private void createAValidLink() {
Expand Down

0 comments on commit 98b38e6

Please sign in to comment.