Skip to content

Commit

Permalink
Add User Research banner to the GOV.UK homepage
Browse files Browse the repository at this point in the history
WIP commit - spacing change required
  • Loading branch information
hannako committed Oct 2, 2023
1 parent 6521193 commit 95c5783
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/views/homepage/_services_and_information.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<section class="homepage-section homepage-section--services-and-info">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%= 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,
} %>
<div class="homepage-section__heading homepage-section__heading--border-none">
<%= render "govuk_publishing_components/components/heading", {
font_size: "m",
Expand All @@ -12,7 +18,7 @@
},
} %>
</div>

<ul class="homepage-services-and-info__list" data-module="gem-track-click ga4-link-tracker">
<% t("homepage.categories").each_with_index do | item, index | %>
<%= render partial: "homepage/chevron_card", locals: {
Expand Down
3 changes: 3 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions test/integration/homepage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95c5783

Please sign in to comment.