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

Lockdown prod flow and update index screen #298

Merged
merged 5 commits into from
Jun 28, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/main/java/org/mdbenefits/app/StaticPageController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
Expand All @@ -13,6 +17,11 @@
*/
@Controller
public class StaticPageController {

@Autowired
private ApplicationContext applicationContext;

private List<String> allowedProfiles = Arrays.asList("demo", "staging", "test", "dev");

/**
* Renders the website index page.
Expand All @@ -31,7 +40,11 @@ ModelAndView getIndex(HttpServletRequest request) {
Map<String, Object> model = new HashMap<>();
model.put("screen", "/");

return new ModelAndView("index", model);
String[] activeProfiles = applicationContext.getEnvironment().getActiveProfiles();
if (allowedProfiles.contains(activeProfiles[0])) {
return new ModelAndView("index", model);
}
return new ModelAndView("pilot-ended", model);
}

@GetMapping("/privacy")
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ form-flow:
key: ${MAILGUN_KEY:'no-key-set'}
domain: 'mg.marylandbenefits.org'
sender-email: 'Maryland Benefits <help@marylandbenefits.org>'
disabled-flows:
- flow: mdBenefitsFlow
staticRedirectPage: '/'
spring:
thymeleaf:
cache: true
Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ upload-documents.this-file-is-too-large=This file is too large and cannot be upl
upload-documents.error-maximum-number-of-files=You have uploaded the maximum number of files.
upload-documents.error-heic=We aren't able to upload this type of file. Please try another file that ends in one of the following:
upload-documents.error-tiff=We aren't able to upload this type of file. Please try another file that ends in one of the following:
demo.banner-text=This site is for example/test purposes only. Please do not enter your personal data here.

demo.banner-text=Oops! This is an example site. Please don?t add your personal data or apply for benefits here. We won?t get it. Apply here instead: <a href="https://mymdthink.maryland.gov/">https://mymdthink.maryland.gov/</a>.

index.title=Maryland Benefits Application
index.header=Get help with the cost of living
index.description=Apply for Maryland Benefits to see how we can help.
Expand All @@ -45,6 +47,9 @@ index.apply-now.link=/flow/mdBenefitsFlow/county?lang=en
index.apply-on-mdthink=<a target="_blank" rel="noreferrer noopener" href="https://mymdthink.maryland.gov/home/#/"/>Apply for benefits on myMDTHINK</a></p>
index.safe-and-secure=Safe and secure
index.state-info=This website is an application tool authorized by the State of Maryland.
index.pilot-over-header=Welcome to applying for benefits in Maryland
index.pilot-over-subheader=Please click below to apply for benefits on myMDTHINK.
index.pilot-over-link=Apply for benefits
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.privacy=Privacy Policy
delete-confirmation-back-redirect.header=This entry has already been deleted
Expand Down Expand Up @@ -122,7 +127,7 @@ privacy.how-we-protect.li3=Only Code for America site administrators will have a
privacy.changes.title=Changes
privacy.changes.p1=We may change this Privacy Policy from time to time. Please check this page frequently for updates, as your continued use of the Site after any changes in this Privacy Policy will constitute your acceptance of the changes. We will notify you via email or other means consistent with applicable law of any material changes to this policy.
privacy.effective-date.title=Effective Date
privacy.effective-date.p1=This version of the policy is effective March 29, 2024.
privacy.effective-date.p1=This version of the policy is effective June 28th, 2024.
privacy.questions.title=Questions


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ <h1 class="spacing-below-15 spacing-above-0" th:utext="#{index.header}"></h1>
</div>
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
</html>
22 changes: 22 additions & 0 deletions src/main/resources/templates/pilot-ended.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head :: head(title=#{index.title})}"></head>
<body>
<div class="page-wrapper">
<div th:replace="~{fragments/toolbar :: toolbar}"></div>
<section class="slab">
<div class="grid">
<main id="content" role="main" class="form-card spacing-above-35">
<th:block th:replace="~{fragments/icons :: nextSteps}"></th:block>
<th:block
th:replace="~{fragments/cardHeader :: cardHeader(header=#{index.pilot-over-header}, subtext=#{index.pilot-over-subheader})}"/>
<div class="form-card__footer">
<a class="button--primary button" href="https://mymdthink.maryland.gov" th:text="#{index.pilot-over-link}"></a>
</div>
</main>
</div>
</section>
</div>
<th:block th:replace="~{fragments/footer :: footer}"/>
</body>
</html>
Loading