From edac0b93a5ab30e9b505fb763c98a23ca8bf34ed Mon Sep 17 00:00:00 2001
From: Alex Gonzalez
Date: Fri, 28 Jun 2024 13:43:50 -0700
Subject: [PATCH] Lockdown prod flow and update index screen (#298)
* Update index screen to show pilot over copy
* Update index screen with pilot over copy and lock down prod flow
* Expand environments that will see normal index screen
* Update privacy policy date
---
.../mdbenefits/app/StaticPageController.java | 15 ++++++++++++-
src/main/resources/application-prod.yaml | 3 +++
src/main/resources/messages.properties | 9 ++++++--
src/main/resources/templates/index.html | 2 +-
src/main/resources/templates/pilot-ended.html | 22 +++++++++++++++++++
5 files changed, 47 insertions(+), 4 deletions(-)
create mode 100644 src/main/resources/templates/pilot-ended.html
diff --git a/src/main/java/org/mdbenefits/app/StaticPageController.java b/src/main/java/org/mdbenefits/app/StaticPageController.java
index af30a397..e286af20 100644
--- a/src/main/java/org/mdbenefits/app/StaticPageController.java
+++ b/src/main/java/org/mdbenefits/app/StaticPageController.java
@@ -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;
@@ -13,6 +17,11 @@
*/
@Controller
public class StaticPageController {
+
+ @Autowired
+ private ApplicationContext applicationContext;
+
+ private List allowedProfiles = Arrays.asList("demo", "staging", "test", "dev");
/**
* Renders the website index page.
@@ -31,7 +40,11 @@ ModelAndView getIndex(HttpServletRequest request) {
Map 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")
diff --git a/src/main/resources/application-prod.yaml b/src/main/resources/application-prod.yaml
index 10155cd0..9b156580 100644
--- a/src/main/resources/application-prod.yaml
+++ b/src/main/resources/application-prod.yaml
@@ -4,6 +4,9 @@ form-flow:
key: ${MAILGUN_KEY:'no-key-set'}
domain: 'mg.marylandbenefits.org'
sender-email: 'Maryland Benefits '
+ disabled-flows:
+ - flow: mdBenefitsFlow
+ staticRedirectPage: '/'
spring:
thymeleaf:
cache: true
diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties
index e9094241..c70439c2 100644
--- a/src/main/resources/messages.properties
+++ b/src/main/resources/messages.properties
@@ -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: https://mymdthink.maryland.gov/.
+
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.
@@ -45,6 +47,9 @@ index.apply-now.link=/flow/mdBenefitsFlow/county?lang=en
index.apply-on-mdthink=Apply for benefits on myMDTHINK
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
@@ -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
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index d5077e99..eabee231 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -40,4 +40,4 @@