From 95c57837ff8dbc3f0bac504ee2d38267a9b35a03 Mon Sep 17 00:00:00 2001 From: Jessica Jones Date: Mon, 2 Oct 2023 14:14:59 +0100 Subject: [PATCH] Add User Research banner to the GOV.UK homepage WIP commit - spacing change required --- app/views/homepage/_services_and_information.html.erb | 8 +++++++- config/locales/cy.yml | 3 +++ config/locales/en.yml | 3 +++ test/integration/homepage_test.rb | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/views/homepage/_services_and_information.html.erb b/app/views/homepage/_services_and_information.html.erb index 17bea7df2e..8b192b3029 100644 --- a/app/views/homepage/_services_and_information.html.erb +++ b/app/views/homepage/_services_and_information.html.erb @@ -1,6 +1,12 @@
+ <%= render "govuk_publishing_components/components/intervention", { + suggestion_text: t("homepage.index.user_research_banner_suggestion_text"), + suggestion_link_text: t("homepage.index.user_research_banner_link_text"), + suggestion_link_url: t("homepage.index.user_research_banner_link_href"), + new_tab: true, + } %>
<%= render "govuk_publishing_components/components/heading", { font_size: "m", @@ -12,7 +18,7 @@ }, } %>
- +
    <% t("homepage.categories").each_with_index do | item, index | %> <%= render partial: "homepage/chevron_card", locals: { diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 51c7f49d58..ec592146e5 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -941,6 +941,9 @@ cy: tax_account: uk_bank_holidays: universal_credit: + user_research_banner_suggestion_text: + user_research_banner_link_text: + user_research_banner_link_href: most_active: 'no': Na or: diff --git a/config/locales/en.yml b/config/locales/en.yml index 749874c34f..ac389fe8ab 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -625,6 +625,9 @@ en: tax_account: Sign in to your personal tax account uk_bank_holidays: UK bank holidays universal_credit: Sign in to your Universal Credit account + user_research_banner_suggestion_text: Help improve GOV.UK + user_research_banner_link_text: Take part in user research (opens in a new tab) + user_research_banner_link_href: https://surveys.publishing.service.gov.uk/s/GOVStudy1/ # If adding or removing items remember to update the `columns()` mixin in # the homepage-most-active-list class in _homepage.scss. most_active: diff --git a/test/integration/homepage_test.rb b/test/integration/homepage_test.rb index 00a77ab24c..8608bc4206 100644 --- a/test/integration/homepage_test.rb +++ b/test/integration/homepage_test.rb @@ -9,6 +9,11 @@ class HomepageTest < ActionDispatch::IntegrationTest visit "/" assert_equal 200, page.status_code assert_equal "Welcome to GOV.UK", page.title + assert page.has_content?(I18n.t("homepage.index.user_research_banner_suggestion_text", locale: :en)) + assert page.has_link?( + I18n.t("homepage.index.user_research_banner_link_text", locale: :en), + href: I18n.t("homepage.index.user_research_banner_link_href", locale: :en), + ) end context "when visiting a Welsh content item first" do