From 2703cad7dfa49965711a6683234eb37cc3e20da0 Mon Sep 17 00:00:00 2001 From: Lorna Date: Thu, 15 Apr 2021 14:35:36 +0100 Subject: [PATCH 01/32] Add email address within header banner for feedback purposes --- .env.example | 2 ++ .env.test | 2 ++ app/helpers/application_helper.rb | 2 +- app/views/layouts/application.html.erb | 2 +- config/locales/en.yml | 3 ++- .../visitors/anyone_can_see_the_service_banners_spec.rb | 3 ++- spec/helpers/application_helper_spec.rb | 2 +- 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 58c48edbf..627a01b3f 100644 --- a/.env.example +++ b/.env.example @@ -17,6 +17,8 @@ REDIS_URL=redis://localhost:6379 # Miscellaneous DAYS_A_JOURNEY_CAN_BE_INACTIVE_FOR=30 +SUPPORT_EMAIL=email@example.gov.uk + # Contentful CONTENTFUL_URL=cdn.contentful.com CONTENTFUL_SPACE= diff --git a/.env.test b/.env.test index 763f048ec..2c83605b4 100644 --- a/.env.test +++ b/.env.test @@ -21,3 +21,5 @@ CONTENTFUL_DEFAULT_CATEGORY_ENTRY_ID=contentful-category-entry # API CONTENTFUL_WEBHOOK_API_KEY= + +SUPPORT_EMAIL=email@example.gov.uk diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index df1e0c629..03cf36e15 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -12,6 +12,6 @@ def banner_tag def banner_message return I18n.t("banner.preview.message") if ENV["CONTENTFUL_PREVIEW_APP"].eql?("true") - I18n.t("banner.beta.message") + I18n.t("banner.beta.message", support_email: ENV.fetch("SUPPORT_EMAIL")) end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c52241019..a7e35a217 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -64,7 +64,7 @@ <%= banner_tag %> - <%= banner_message %> + <%= banner_message.html_safe %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 3fbd34747..4e1577a2b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -15,7 +15,8 @@ en: banner: beta: tag: "beta" - message: "This is a new service - your feedback will help us to improve it." + message: + This is a new service – your feedback will help us to improve it. preview: tag: "preview" message: "This environment is only for previewing Contentful changes before publishing." diff --git a/spec/features/visitors/anyone_can_see_the_service_banners_spec.rb b/spec/features/visitors/anyone_can_see_the_service_banners_spec.rb index ccd85d3c3..e83c1b1a5 100644 --- a/spec/features/visitors/anyone_can_see_the_service_banners_spec.rb +++ b/spec/features/visitors/anyone_can_see_the_service_banners_spec.rb @@ -3,7 +3,8 @@ visit root_path expect(page).to have_content(I18n.t("banner.beta.tag")) - expect(page).to have_content(I18n.t("banner.beta.message")) + expect(page.html).to include(I18n.t("banner.beta.message", support_email: ENV.fetch("SUPPORT_EMAIL"))) + expect(page).to have_content(ENV["SUPPORT_EMAIL"]) end context "when the app is configured as a Contenetful preview app" do diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index f920635db..4d81590df 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -39,7 +39,7 @@ describe "#banner_message" do it "returns the beta message by default" do - expect(helper.banner_message).to eq(I18n.t("banner.beta.message")) + expect(helper.banner_message).to eq(I18n.t("banner.beta.message", support_email: ENV.fetch("SUPPORT_EMAIL"))) end context "when PREVIEW_APP is configured to true" do From b27095d533fbb201cae668cb08a91f00640896be Mon Sep 17 00:00:00 2001 From: Lorna Date: Thu, 15 Apr 2021 17:04:39 +0100 Subject: [PATCH 02/32] Add data policy details within footer --- CHANGELOG.md | 1 + app/helpers/application_helper.rb | 4 ++++ app/views/layouts/application.html.erb | 4 ++++ config/locales/en.yml | 3 +++ ....rb => anyone_can_see_the_service_components_spec.rb} | 9 ++++++++- spec/helpers/application_helper_spec.rb | 6 ++++++ 6 files changed, 26 insertions(+), 1 deletion(-) rename spec/features/visitors/{anyone_can_see_the_service_banners_spec.rb => anyone_can_see_the_service_components_spec.rb} (70%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 725f21f21..c0f1ac389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog 1.0.0]. ## [Unreleased] +- add header and footer information for feedback and data requests ## [release-009] - 2021-05-21 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 03cf36e15..bc9625f77 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,4 +14,8 @@ def banner_message return I18n.t("banner.preview.message") if ENV["CONTENTFUL_PREVIEW_APP"].eql?("true") I18n.t("banner.beta.message", support_email: ENV.fetch("SUPPORT_EMAIL")) end + + def footer_message + I18n.t("banner.footer.message", support_email: ENV.fetch("SUPPORT_EMAIL")) + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a7e35a217..c27cff712 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -79,6 +79,10 @@