Skip to content

Commit

Permalink
Merge pull request #3867 from alphagov/govuk-chat-promo-more-links
Browse files Browse the repository at this point in the history
GOV.UK Chat promo: show on more pages
  • Loading branch information
jackbot authored Nov 26, 2024
2 parents 3bdd0c0 + a04d694 commit e263b39
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
16 changes: 15 additions & 1 deletion app/helpers/govuk_chat_promo_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
module GovukChatPromoHelper
GOVUK_CHAT_PROMO_BASE_PATHS = %w[
/browse/benefits/looking-for-work
/browse/business
/browse/business/business-tax
/browse/business/limited-company
/browse/business/setting-up
/browse/employing-people
/browse/employing-people/payroll
/browse/employing-people/recruiting-hiring
/browse/tax
/browse/tax/capital-gains
/browse/tax/dealing-with-hmrc
/browse/tax/self-assessment
/set-up-limited-company
/browse/tax/vat
/browse/working
/browse/working/finding-job
/browse/working/state-pension
/browse/working/time-off
/browse/working/workplace-personal-pensions
/set-up-as-sole-trader
/set-up-limited-company
].freeze

def show_govuk_chat_promo?(base_path)
Expand Down
10 changes: 9 additions & 1 deletion app/views/second_level_browse_page/show_a_to_z.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<% end %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds govuk-!-margin-bottom-2" data-module="ga4-link-tracker">
<%
index_section_count = page.lists.count
Expand All @@ -49,5 +49,13 @@
</div>
<% end %>
</div>

<% if show_govuk_chat_promo?(page.base_path) %>
<div class="govuk-grid-column-one-third-from-desktop">
<div class="browse__govuk-chat-promo">
<%= render "govuk_publishing_components/components/chat_entry" %>
</div>
</div>
<% end %>
</div>
</div>
2 changes: 1 addition & 1 deletion spec/features/mainstream_browsing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

it "renders the GOV.UK Chat promo" do
content_item = GovukSchemas::Example.find("mainstream_browse_page", example_name: "top_level_page").tap do |item|
item["base_path"] = GovukChatPromoHelper::GOVUK_CHAT_PROMO_BASE_PATHS.first
item["base_path"] = "/browse/business"
end

stub_content_store_has_item(content_item["base_path"], content_item)
Expand Down

0 comments on commit e263b39

Please sign in to comment.