Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIC ECE design updates #485

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import formflow.library.config.submission.Action;
import formflow.library.data.Submission;
import org.joda.time.DateTime;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
Expand All @@ -13,7 +14,11 @@
@Component
public class FormatSubmittedAtDate implements Action {
public final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MMMM d, yyyy");
private static final long TEN_DAYS = (1000 * 60 * 60 * 24) * 10;
private static final long ONE_DAY = 1000 * 60 * 60 * 24;
private static final long TEN_BUSINESS_DAYS = ONE_DAY * 14;

private static final int SATURDAY = 6;
private static final int SUNDAY = 7;

@Override
public void run(Submission submission) {
Expand All @@ -23,7 +28,14 @@ public void run(Submission submission) {
String formattedSubmittedAt = DATE_FORMAT.format(submittedAt);
submission.getInputData().put("formattedSubmittedAt", formattedSubmittedAt);

String interviewDate = DATE_FORMAT.format(new Date(submittedAt.getTime() + TEN_DAYS));
DateTime submittedDate = new DateTime(submittedAt);
long tenDaysLater = submittedAt.getTime() + TEN_BUSINESS_DAYS;
if (submittedDate.getDayOfWeek() == SATURDAY) {
tenDaysLater -= ONE_DAY;
} else if (submittedDate.getDayOfWeek() == SUNDAY) {
tenDaysLater -= 2 * ONE_DAY;
}
String interviewDate = DATE_FORMAT.format(new Date(tenDaysLater));
submission.getInputData().put("interviewDate", interviewDate);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.ladocuploader.app.submission.conditions;

import formflow.library.config.submission.Condition;
import formflow.library.data.Submission;
import org.springframework.stereotype.Component;

@Component
public class InterestedInWicEce implements Condition {

private final InNolaParish inNola;
private final InterestedInECE interestedInECE;
private final InterestedInWIC interestedInWIC;

public InterestedInWicEce(InNolaParish inNola, InterestedInECE interestedInECE, InterestedInWIC interestedInWIC) {
this.inNola = inNola;
this.interestedInECE = interestedInECE;
this.interestedInWIC = interestedInWIC;
}

@Override
public Boolean run(Submission submission) {
return inNola.run(submission) && (interestedInECE.run(submission) || interestedInWIC.run(submission));
}
}
4 changes: 3 additions & 1 deletion src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,10 @@ flow:
wicApply:
nextScreens:
- name: nolaApplyThankYou
condition: InNolaParish
condition: InterestedInWicEce
- name: outsideNolaApplyThankYou
condition: InterestedInWIC
- name: finalSignPost
nolaApplyThankYou:
nextScreens:
- name: finalSignPost
Expand Down
14 changes: 7 additions & 7 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ confirmation.helpful-resources.l1=Return to <a href="benefits.dcfs.la.gov">benef
confirmation.helpful-resources.l2=<a href="https://cafe-cp.dcfs.la.gov/selfservice/">Create an account in LA CAF\u00C9</a> to manage your benefits.
confirmation.next-steps=Your next steps
confirmation.next-steps-immediate=Your immediate next steps
confirmation.p1_html=<b>You are required to complete an interview.</b> You''ll receive an appointment letter by <b>{0}</b> with your interview details.<br/><br/> If you don't get your letter by then, please call the following toll free number <a href="tel:(833) 323-7482">(833) 323-7482</a> between Monday - Friday, 8 AM-2 PM by to schedule an interview.
confirmation.p1_html=<b>You are required to complete an interview.</b> You''ll receive an appointment letter by <b>{0}</b> with your interview details.<br/><br/> If you don''t get your letter by then, please call the following toll free number <a href="tel:(833) 323-7482">(833) 323-7482</a> between Monday - Friday, 8 AM-2 PM by to schedule an interview.
confirmation.looking_for_job_html=<b>You are required to create a HiRE account.</b> <a target="_blank" rel="noreferrer noopener" href="https://www.louisianaworks.net/hire/vosnet/loginintro.aspx">Create a HiRE account on Louisiana Works</a> in order to receive SNAP benefits.
confirmation.p2_html=Within the next 30 days, <b>expect to get a letter in the mail</b> about your application. The letter will tell you if you are eligible or not.
confirmation.p3=Call LAHelpU at <a href="tel:(888) 524-3578">(888) 524-3578</a> if you have any questions about your online application.
Expand Down Expand Up @@ -1118,21 +1118,21 @@ wic.based-on-your-answers=Based on your answers, you might qualify for <b>Women,
wic.would-you-like-share-data=Would you like to share your data with WIC to see if you qualify?

nola-ece-links.title=ECE link
nola-ece.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for free childcare and pre-K.
nola-ece.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for <u>free</u> childcare and pre-K.
nola-ece.subheader=These programs can:<ul class="list--bulleted"> <li>Provide free childcare and education for children from birth through age 4</li> <li>Provide free pre-K in public or private school for 4-year-olds</li></ul>
nola-ece-links.at-the-end-of-this-app=At the end of this application, we\u2019ll show you a clickable link to the NOLA Public Schools application (enrollnolaps.com).
nola-ece-links.are-you-interested=Are you interested in free childcare or pre-K?
nola-ece-go-to-application=Go to the ECE application

wic-links.title=WIC link
wic.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for the Women, Infants, and Children (WIC) program.
wic.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for WIC.
wic.subheader=WIC can:<ul class="list--bulleted"> <li>Provide infant formula</li> <li>Provide a WIC EBT card for healthy food</li> <li>Provide nutrition education</li></ul>
wic-links.at-the-end-of-this-app=At the end of this application, we\u2019ll show you a clickable link to the WIC application (surveymonkey.com/r/LAWIC_InterestForm).
wic-links.are-you-interested=Are you interested in the WIC nutrition program?
wic-go-to-application=Go to the WIC application

ece-yes-confirmation.header=Here is the link for submitting an application for free childcare and pre-K!
ece-no-confirmation.header=Here\u2019s one more chance to apply for free childcare and pre-K.
ece-yes-confirmation.header=Here is the link for submitting an application for <u>free</u> childcare and pre-K!
ece-no-confirmation.header=Here\u2019s one more chance to apply for <u>free</u> childcare and pre-K.
wic-yes-confirmation.header=Here is the link for submitting an application for the Women, Infants, and Children (WIC) program!
wic-no-confirmation.header=Here\u2019s one more chance to apply for the WIC nutrition program.

Expand All @@ -1141,8 +1141,8 @@ nola-ece-apply.would-you-like=Would you like us to send your information to New
nola-ece-apply.would-you-like-help=NOLA-PS would contact you to finish the application.
nola-ece-apply.yes-start-app=Yes, start my free childcare app

ece-notice-confirmation=<b>Free Childcare or Pre-K: You are required to finish your application with the New Orleans Public Schools.</b> You will receive a text from NOLA-PS within one week, with a link to finish your application and list the childcare and pre-K programs you would like to apply to. <br/><br/>While you wait, you can go to nola.explore.avela.org to find programs you like!
wic-notice-confirmation=<b>WIC: You are required to finish your application with the Louisiana Department of Health.</b> You will be contacted by a WIC clinic staff member to schedule an appointment to complete the final steps.<br/><br/>You can also call a local WIC clinic directly to schedule an in-person appointment. Visit this map to find a clinic near you.
ece-notice-confirmation=<b>Free Childcare or Pre-K: You are required to finish your application with the New Orleans Public Schools.</b> You will receive a text from NOLA-PS within one week, with a link to finish your application and list the childcare and pre-K programs you would like to apply to. <br/><br/>While you wait, you can go to <a target="_blank" href="nola.explore.avela.org">nola.explore.avela.org</a> to find programs you like!
wic-notice-confirmation=<b>WIC: You are required to finish your application with the Louisiana Department of Health.</b> You will be contacted by a WIC clinic staff member to schedule an appointment to complete the final steps.<br/><br/>You can also call a local WIC clinic directly to schedule an in-person appointment. <a target="_blank" href="https://louisianawic.org/search-tool/">Visit this map</a> to find a clinic near you.
confirmation-what-to-expect-after=What to expect after
confirmation-for-snap=<b>For SNAP</b>
confirmation-for-snap-questions=<b>For SNAP questions</b>
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/templates/fragments/cardHeader.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<header
th:fragment="cardHeader"
th:with="hasSubtext=${!#strings.isEmpty(subtext)}"
th:assert="${!#strings.isEmpty(header)}"
class="form-card__header">
<h1 id="header" class="h2" th:utext="${header}"></h1>
<p id="header-help-message"
th:if="${hasSubtext}"
th:utext="${subtext}"></p>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ <h2 class="h2" th:text="#{confirmation.next-steps-immediate}"></h2>
<th:block th:if="${inNola}">
<th:block th:if="${!isInterestedInECE}">
<hr>
<h2 class="h2" th:text="#{ece-no-confirmation.header}"></h2>
<h2 class="h2" th:utext="#{ece-no-confirmation.header}"></h2>
</th:block>
<th:block th:if="${inLinkGroup && isInterestedInECE}">
<hr>
<h2 class="h2" th:text="#{ece-yes-confirmation.header}"></h2>
<h2 class="h2" th:utext="#{ece-yes-confirmation.header}"></h2>
</th:block>
<th:block th:if="${!isInterestedInECE || inLinkGroup}">
<p th:text="#{nola-ece.if-youre-approved}"></p>
<p th:utext="#{nola-ece.if-youre-approved}"></p>
<p th:utext="#{nola-ece.subheader}"></p>
<a class="button button--primary" target="_blank" href="http://apply.avela.org/nolaps"
th:text="#{nola-ece-go-to-application}"></a>
Expand Down
34 changes: 17 additions & 17 deletions src/main/resources/templates/laDigitalAssister/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,6 @@
<th:block
th:replace="~{fragments/form :: form(action=${formAction}, content=~{::formContent})}">
<th:block th:ref="formContent">
<th:block th:replace="~{'fragments/honeycrisp/reveal' :: reveal(
controlId='r1',
linkLabel=~{::revealLabel1},
content=~{::revealContent1},
forceShowContent='true')}">
<th:block th:ref="revealLabel1">
<i class="icon-">&#xE862;</i>
<th:span th:text="#{confirmation.helpful-resources}"></th:span>
</th:block>
<th:block th:ref="revealContent1">
<ul class="list--bulleted">
<li th:utext="#{confirmation.helpful-resources.l1}"></li>
<li th:utext="#{confirmation.helpful-resources.l2}"></li>
</ul>
</th:block>
</th:block>

<div th:replace="~{fragments/wicEceConfirmation :: wicEceConfirmation}"></div>

<th:block th:unless="${inApplyGroup || inLinkGroup}">
Expand Down Expand Up @@ -72,6 +55,23 @@ <h2 class="h2" th:text="#{confirmation.next-steps}"></h2>
</div>
</th:block>

<th:block th:replace="~{'fragments/honeycrisp/reveal' :: reveal(
controlId='r1',
linkLabel=~{::revealLabel1},
content=~{::revealContent1},
forceShowContent='true')}">
<th:block th:ref="revealLabel1">
<i class="icon-">&#xE862;</i>
<th:span th:text="#{confirmation.helpful-resources}"></th:span>
</th:block>
<th:block th:ref="revealContent1">
<ul class="list--bulleted">
<li th:utext="#{confirmation.helpful-resources.l1}"></li>
<li th:utext="#{confirmation.helpful-resources.l2}"></li>
</ul>
</th:block>
</th:block>

<div th:replace="~{fragments/feedback :: feedback}"></div>

</th:block>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.ladocuploader.app.submission.actions;

import formflow.library.data.Submission;
import org.joda.time.LocalDate;
import org.junit.jupiter.api.Test;

import java.util.Date;
import java.util.HashMap;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

class FormatSubmittedAtDateTest {

private final FormatSubmittedAtDate action = new FormatSubmittedAtDate();

@Test
public void testWeekday() {
Date friday = new LocalDate("2023-12-22").toDate();
Submission submission = Submission.builder()
.urlParams(new HashMap<>())
.inputData(new HashMap<>())
.submittedAt(friday)
.build();

action.run(submission);

String formattedDate = "December 22, 2023";
String interviewDate = "January 5, 2024";
assertThat(submission.getInputData().get("formattedSubmittedAt")).isEqualTo(formattedDate);
assertThat(submission.getInputData().get("interviewDate")).isEqualTo(interviewDate);
}

@Test
public void testSaturday() {
Date friday = new LocalDate("2023-12-23").toDate();
Submission submission = Submission.builder()
.urlParams(new HashMap<>())
.inputData(new HashMap<>())
.submittedAt(friday)
.build();

action.run(submission);

String formattedDate = "December 23, 2023";
String interviewDate = "January 5, 2024";
assertThat(submission.getInputData().get("formattedSubmittedAt")).isEqualTo(formattedDate);
assertThat(submission.getInputData().get("interviewDate")).isEqualTo(interviewDate);
}

@Test
public void testSunday() {
Date friday = new LocalDate("2023-12-24").toDate();
Submission submission = Submission.builder()
.urlParams(new HashMap<>())
.inputData(new HashMap<>())
.submittedAt(friday)
.build();

action.run(submission);

String formattedDate = "December 24, 2023";
String interviewDate = "January 5, 2024";
assertThat(submission.getInputData().get("formattedSubmittedAt")).isEqualTo(formattedDate);
assertThat(submission.getInputData().get("interviewDate")).isEqualTo(interviewDate);
}

}