Skip to content

Commit

Permalink
Changed based on feedback and design changes.
Browse files Browse the repository at this point in the history
Swaps order of County and Select Application pages (per design changes).
Changes ApplicationDescriptionType enum to ApplicantObjectives.
Removes OHEP option (comments it out)
Fixes link in myMDTHINK redirect.
  • Loading branch information
bseeger committed Jan 31, 2024
1 parent bae27ad commit 1157d4a
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.Getter;

@Getter
public enum ApplicationDescriptionType {
public enum ApplicantObjective {

NEED_HELP_IN_OTHER_LANGUAGE("I need help in a language that isn’t English ((Español, 中文, Tiếng Việt)", "select-app.help-in-other-language"),
COLLEGE_STUDENT_IN_APP("I am a college student or have a student who will be on my aplication", "select-app.college-student-in-home"),
Expand All @@ -15,7 +15,7 @@ public enum ApplicationDescriptionType {
private final String value;
private final String labelSrc;

ApplicationDescriptionType(String value, String labelSrc) {
ApplicantObjective(String value, String labelSrc) {
this.value = value;
this.labelSrc = labelSrc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.mdbenefits.app.data.enums.ProgramType.SNAP;
import static org.mdbenefits.app.data.enums.ProgramType.TCA;
import static org.mdbenefits.app.data.enums.ProgramType.OHEP;
//import static org.mdbenefits.app.data.enums.ProgramType.OHEP;
import static org.mdbenefits.app.data.enums.ProgramType.TDAP;
import static org.mdbenefits.app.data.enums.ProgramType.OTHER;

Expand All @@ -13,7 +13,7 @@ public enum HelpNeededType {

FOOD("Help with food", "help-needed.food", SNAP),
CHILDREN("Help with money for children", "help-needed.children", TCA),
UTILITIES("Help with utilities", "help-needed.utilities", OHEP),
//UTILITIES("Help with utilities", "help-needed.utilities", OHEP),
DISABILITY("Help for a disability", "help-needed.disability", TDAP),
NOT_SURE("I'm not sure", "help-needed.not-sure", OTHER);

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/mdbenefits/app/data/enums/ProgramType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public enum ProgramType {

SNAP("choose-programs.snap", "choose-programs.snap.short-desc", "choose-programs.snap.desc"),
TCA("choose-programs.tca","choose-programs.tca.short-desc","choose-programs.tca.desc"),
// OHEP is here, but will not be displayed as the HelpNeeded option that would
// display this is commented out
// Leaving this in for now in case it's helpful for our future logic to have it
OHEP("choose-programs.ohep", "choose-programs.ohep.short-desc", "choose-programs.ohep.desc"),
TDAP("choose-programs.tdap", "choose-programs.tdap.short-desc", "choose-programs.tdap.desc"),
OTHER("choose-programs.other", "", "choose-programs.other.desc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.mdbenefits.app.data.enums.ApplicationDescriptionType;
import org.mdbenefits.app.data.enums.ApplicantObjective;
import org.mdbenefits.app.data.enums.Counties;
import org.springframework.stereotype.Component;

/**
* If certain conditions are met, we will have the flow go to a page
* that recommends the user visit MDTHINK instead.
* The conditions are that they selected a county that this demo is not for,
* or they have a situation that our pilot cannot work with.
* that recommends the user visit myMDTHINK instead.
* <p>
* This will return true (for a redirect) if:
* <ol>
* <li>they are in a county this pilot is not working in, or</li>
* <li>they have a need that this pilot is unable to work with</li>
* </ol>
* </p>
*/
@Component
public class ShouldRedirectToMDThink implements Condition {
Expand All @@ -35,7 +40,7 @@ public Boolean run(Submission submission) {
return true;
}

if (!applicationInfoList.isEmpty() && !applicationInfoList.contains(ApplicationDescriptionType.OTHER.getValue())) {
if (!applicationInfoList.isEmpty() && !applicationInfoList.contains(ApplicantObjective.OTHER.getValue())) {
return true;
}

Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: mdBenefitsFlow
flow:
selectApplication:
county:
nextScreens:
- name: redirectToMDThink
condition: ShouldRedirectToMDThink
- name: county
county:
- name: selectApplication
selectApplication:
nextScreens:
- name: redirectToMDThink
condition: ShouldRedirectToMDThink
Expand Down Expand Up @@ -439,6 +439,7 @@ flow:
nextScreens:
- name: confirmation
landmarks:
firstScreen: county
afterSubmitPages:
- confirmation
subflows:
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ index.title=Maryland Benefits Application
index.header=Welcome to the <em> new </em> Maryland Benefits application experience.
index.description=We're working to make applying for benefits easier. Thanks for your patience while we build the new site. You can still apply on the original site using the link below.
index.apply-now=Apply Now <i class="button__icon icon-arrow_forward"></i>
index.apply-now.link=/flow/mdBenefitsFlow/selectApplication?lang=en
index.apply-on-mdthink=Apply for benefits on <a target="_blank" rel="noreferrer noopener" href="https://mymdthink.maryland.gov/home/#/"/>MDTHINK</a>.</p>
index.apply-now.link=/flow/mdBenefitsFlow/county?lang=en
index.apply-on-mdthink=Apply for benefits on <a target="_blank" rel="noreferrer noopener" href="https://mymdthink.maryland.gov/home/#/"/>myMDTHINK</a>.</p>

footer.this-benefits-application-is=This benefits application is a service built by Code for America in partnership with the state of Maryland, on behalf of the people of Maryland.
footer.faq=Frequently Asked Questions (FAQ)
Expand Down Expand Up @@ -248,7 +248,7 @@ language-preference.vietnamese=Vietnamese

# Select Application
select-app.title=Select application
select-app.header=Welcome to the Maryland Benefits application experience <br> <br>Which of these are true for you?
select-app.header=Which of these are true for you?
select-app.subheader=We want to make sure we send you to the best application for you.
select-app.help-in-other-language=I need help in a language that isn't English (Espa\u00F1ol, \u4e2d\u6587, Ti\u1EBFng Vi\u1EC7t)
select-app.college-student-in-home=I am a college student or have a student who will be on my aplication
Expand All @@ -267,10 +267,10 @@ help-needed.disability=Help for a disability
help-needed.not-sure=I'm not sure

# MD Think redirect
redirect.mdthink.title=MDTHINK Redirect
redirect.mdthink.title=myMDTHINK Redirect
redirect.mdthink.header=Please use the link below to start your application.
redirect.mdthink.subheader=
redirect.mdthink.linktext=Apply for benefits on MDTHINK
redirect.mdthink.linktext=Apply for benefits on myMDTHINK


# Choose programs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
th:replace="~{fragments/cardHeader :: cardHeader(header=#{redirect.mdthink.header})}"/>
<th:block>
<div class="form-card__content">
<a th:text="#{redirect.mdthink.linktext}"
href="https://identity.mymdthink.maryland.gov/identityiq/external/portal-registration.jsf?gotoUrl=https://mymdthink.maryland.gov/cp/"
target="_blank">
</a>
<p th:utext="#{index.apply-on-mdthink}"></p>
</div>
</th:block>
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
label=#{general.check-all-that-apply},
content=~{::content})}">
<th:block th:ref="content">
<th:block th:each="appDescType : ${T(org.mdbenefits.app.data.enums.ApplicationDescriptionType).values()}">
<th:block th:each="appObjective : ${T(org.mdbenefits.app.data.enums.ApplicantObjective).values()}">
<th:block
th:replace="~{fragments/inputs/checkboxInSet :: checkboxInSet(
inputName='applicationInfo',
value=${appDescType.getValue()},
label=#{${appDescType.getLabelSrc()}},
noneOfTheAbove=${appDescType.name().equals('OTHER')}
value=${appObjective.getValue()},
label=#{${appObjective.getLabelSrc()}},
noneOfTheAbove=${appObjective.name().equals('OTHER')}
)}">
</th:block>
</th:block>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,37 @@ public class MdBenefitsFlowJourneyTest extends AbstractBasePageTest {
protected static final String RANGE_ERROR_MESSAGE = "Make sure to provide a value between 1 and 100.";

@Test
void redirectMDThink() {
void redirectToMyMDTHINKOnUnsupportedApplicationType() {
testPage.navigateToFlowScreen("mdBenefitsFlow/selectApplication");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo("Select application");
assertThat(testPage.hasErrorText(message("error.missing-general")));

// there are two scenarios where we redirect to MDTHINK
// 1. they need more help than this site can give.
// 2. they live in a county that our site doesn't currently support

// scenario one - they don't choose the "other" option:
// should redirect to MyMDTHINK
testPage.clickElementById("applicationInfo-" + message("select-app.college-student-in-home"));
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo(message("redirect.mdthink.title"));

// should not redirect
testPage.navigateToFlowScreen("mdBenefitsFlow/selectApplication");
testPage.clickElementById("none__checkbox");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo(message("county.title"));
assertThat(testPage.getTitle()).isEqualTo(message("help-needed.title"));
}

// scenario two - they choose a county we don't support
@Test
void redirectToMyMDTHINKOnUnsupportedCounty() {
testPage.navigateToFlowScreen("mdBenefitsFlow/county");
// should redirect to MyMDTHINK
testPage.selectFromDropdown("county", "Frederick County");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo(message("redirect.mdthink.title"));

// should not redirect
testPage.navigateToFlowScreen("mdBenefitsFlow/county");
testPage.selectFromDropdown("county", "Baltimore County");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo(message("help-needed.title"));
assertThat(testPage.getTitle()).isEqualTo(message("select-app.title"));
}

@Test
Expand Down Expand Up @@ -356,27 +358,24 @@ void completeFlow() {
assertThat(testPage.getTitle()).isEqualTo("Maryland Benefits Application");

testPage.clickButton("Apply Now");
assertThat(testPage.getTitle()).isEqualTo("County");

testPage.selectFromDropdown("county", "Baltimore County");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo("Select application");

testPage.clickElementById("none__checkbox");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo("County");

testPage.selectFromDropdown("county", "Baltimore County");
testPage.clickContinue();
assertThat(testPage.getTitle()).isEqualTo("Select help");

testPage.clickElementById("helpNeeded-SNAP");
testPage.clickElementById("helpNeeded-OHEP");
testPage.clickElementById("helpNeeded-TCA");
testPage.clickContinue();

// choose program
assertThat(testPage.getTitle()).isEqualTo(message("choose-programs.title"));

testPage.clickElementById("programs-SNAP");
testPage.clickElementById("programs-OHEP");
testPage.clickElementById("programs-TCA");

testPage.clickContinue();
Expand Down

0 comments on commit 1157d4a

Please sign in to comment.