Skip to content

Commit

Permalink
Adding meals screens
Browse files Browse the repository at this point in the history
  • Loading branch information
sree-cfa committed Oct 13, 2023
1 parent 0b4df32 commit 885d1c7
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public class LaDigitalAssister extends FlowInputs {

private String roomRentals;

private String mealInd;

private String meals;

private String householdSearchingForJob;

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

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

@Component
public class PayForMeals extends BasicCondition {

@Override
public Boolean run(Submission submission) {
return run(submission, "mealInd", "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 @@ -181,6 +181,8 @@ flow:
householdMeals:
nextScreens:
- name: householdMealsWho
condition: PayForMeals
- name: sensitiveQuestions
householdMealsWho:
nextScreens:
- name: sensitiveQuestions
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,13 @@ household-room-rental.header=Does anyone in your household rent a room?
household-room-rental-who.title=Room rental who
household-room-rental-who.header=Who rents a room?

# Meals
household-meals.title=Meals
household-meals.header=Does anyone in your household pay for their meals as part of their living arrangements?
household-meals.subtext=<p>This could include:<ul class="list--bulleted"> <li>Someone who pays monthly for room and board</li> <li>Someone who receives at least 1 meal as part of rent</li> <li>Someone who receives more than half their meals from an organization</li></ul></p>
household-meals-who.title=Meals who
household-meals-who.header=Who pays for meals as part of their living arrangements?

# Review contact info
review-contact-info.title=Review contact information
review-contact-info.header=Let's review your info
Expand Down
18 changes: 8 additions & 10 deletions src/main/resources/templates/laDigitalAssister/householdMeals.html
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-meals.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-meals.header}, subtext=#{household-meals.subtext})}"/>
<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='mealInd',
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-meals-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-meals-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='meals')}">
</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 @@ -179,16 +179,25 @@ void fullDigitalAssisterFlow() {

assertThat(testPage.getTitle()).isEqualTo("Room rental");
testPage.clickButton("No");
assertThat(testPage.getTitle()).isEqualTo("Scaffold"); // Meals
assertThat(testPage.getTitle()).isEqualTo("Meals");
testPage.goBack();
testPage.clickButton("Yes");

assertThat(testPage.getTitle()).isEqualTo("Room rental who");
testPage.clickElementById("roomRentals-you");
testPage.clickContinue();

assertThat(testPage.getTitle()).isEqualTo("Meals");
testPage.clickButton("No");
assertThat(testPage.getTitle()).isEqualTo("Sensitive Questions");
testPage.goBack();
testPage.clickButton("Yes");

assertThat(testPage.getTitle()).isEqualTo("Meals who");
testPage.clickElementById("meals-you");
testPage.clickContinue();

// Sensitive Questions
testPage.navigateToFlowScreen("laDigitalAssister/sensitiveQuestions");
assertThat(testPage.getTitle()).isEqualTo("Sensitive Questions");
testPage.clickContinue();

Expand Down

0 comments on commit 885d1c7

Please sign in to comment.