Skip to content

Commit

Permalink
Adding prepare food screens (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
sree-cfa authored Oct 12, 2023
1 parent b74ab2d commit 3e664dc
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public class LaDigitalAssister extends FlowInputs {

private String receivedOutOfStateBenefits;

private String buyPrepareMealsSeparateIndicator;

private String preparesFood;

private String migrantOrSeasonalFarmWorkerInd;

private String citizenshipInd;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.ladocuploader.app.submission.conditions;

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

@Component
public class PreparesFoodTogether extends BasicCondition {
@Override
public Boolean run(Submission submission) {
return run(submission, "buyPrepareMealsSeparateIndicator", "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 @@ -118,6 +118,8 @@ flow:
- name: householdPrepareFood
householdPrepareFood:
nextScreens:
- name: householdSeasonalFarmWorker
condition: PreparesFoodTogether
- name: householdPrepareFoodWho
householdPrepareFoodWho:
nextScreens:
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@ pregnancy.header=Are you pregnant?
out-of-state-benefits.title=Out of state benefits
out-of-state-benefits.header=Have you received cash assistance or SNAP benefits from another state?

# Household prepare food
household-prepare-food.title=Prepare food
household-prepare-food.header=Does everyone in your household buy and prepare food with you?
household-prepare-food-who.title=Prepare food who
household-prepare-food-who.header=Who in your household buys and prepares food with you?

# Seasonal farmworker
seasonal-farmworker.title=Seasonal farm worker
seasonal-farmworker.header=Is anyone in your household a migrant or seasonal farm worker?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head>
<head th:replace="~{fragments/head :: head(title=#{household-prepare-food.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=#{}, subtext=#{})}"/>-->
<th:block th:replace="~{fragments/icons :: 'groceries'}"></th:block>
<th:block
th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{household-prepare-food.header})}"/>
<th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
<th:block th:replace="fragments/inputs/yesOrNo :: yesOrNo(
inputName='buyPrepareMealsSeparateIndicator',
ariaDescribe='header')"/>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="~{fragments/footer :: footer}" />
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head>
<head th:replace="~{fragments/head :: head(title=#{household-prepare-food-who.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=#{}, subtext=#{})}"/>-->
<th:block th:replace="~{fragments/icons :: 'groceries'}"></th:block>
<th:block
th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{household-prepare-food-who.header})}"/>
<th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}">
<th:block th:ref="formContent">
<div class="form-card__content">

<th:block th:replace="~{'fragments/inputs/householdCheckboxFieldset' ::
householdCheckboxFieldset(inputName='preparesFood')}">
</th:block>
</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}" />
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ void fullDigitalAssisterFlow() {
assertThat(testPage.getTitle()).isEqualTo("Job search who");

// SNAP
testPage.navigateToFlowScreen("laDigitalAssister/householdSeasonalFarmWorker");
testPage.navigateToFlowScreen("laDigitalAssister/householdPrepareFood");
assertThat(testPage.getTitle()).isEqualTo("Prepare food");
testPage.clickButton("No");

assertThat(testPage.getTitle()).isEqualTo("Prepare food who");
testPage.clickElementById("preparesFood-you");
testPage.clickContinue();

assertThat(testPage.getTitle()).isEqualTo("Seasonal farm worker");
testPage.clickButton("Yes");

Expand Down

0 comments on commit 3e664dc

Please sign in to comment.