Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GOV.UK Chat promo banner #3927

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions app/assets/stylesheets/views/_browse.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,3 @@ $browse-header-background-colour: #263135;
margin-bottom: govuk-spacing(6);
}
}

.browse__govuk-chat-promo {
background-color: govuk-tint(govuk-colour("blue"), 90%);
padding: govuk-spacing(4) 0;

// we're using this component in an unconventional way so need to undo
// basic styling
.gem-c-chat-entry {
padding: 0;
}
}
29 changes: 0 additions & 29 deletions app/helpers/govuk_chat_promo_helper.rb

This file was deleted.

11 changes: 4 additions & 7 deletions app/views/browse/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
} %>
<% end %>

<%= render "shared/browse_header", {
margin_bottom: page.slug == "benefits" ? 7 : 9,
govuk_chat_promo: show_govuk_chat_promo?(page.base_path),
} do %>
<%= render "shared/browse_header", { margin_bottom: page.slug == "benefits" ? 7 : 9 } do %>
<%= render "govuk_publishing_components/components/heading", {
text: page.title,
inverse: true,
Expand All @@ -40,9 +37,9 @@
<%= render "govuk_web_banners/recruitment_banner" %>
<% if page.popular_list %>
<div class="govuk-width-container">
<div class="browse__action-links">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="browse__action-links">
<%= render "govuk_publishing_components/components/heading", {
text: t("browse.popular_tasks"),
margin_bottom: 6,
Expand Down
1 change: 0 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 @@ -20,7 +20,6 @@
<%= render "shared/browse_header", {
margin_bottom: 8,
two_thirds: true,
govuk_chat_promo: show_govuk_chat_promo?(page.base_path),
} do %>
<%= render "govuk_publishing_components/components/heading", {
font_size: "xl",
Expand Down
6 changes: 1 addition & 5 deletions app/views/second_level_browse_page/show_curated.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
<%= render "shared/browse_breadcrumbs" %>
<% end %>

<%= render "shared/browse_header", {
two_thirds: true,
margin_bottom: 8,
govuk_chat_promo: show_govuk_chat_promo?(page.base_path),
} do %>
<%= render "shared/browse_header", { two_thirds: true, margin_bottom: 8 } do %>
<%= render "govuk_publishing_components/components/heading", {
font_size: "xl",
heading_level: 1,
Expand Down
34 changes: 5 additions & 29 deletions app/views/shared/_browse_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
two_thirds ||= false
margin_bottom ||= 0
padding_top ||= false
govuk_chat_promo ||= false

header_wrapper_classes = []
header_wrapper_classes = %w(browse__header-wrapper)
header_wrapper_classes << "govuk-!-margin-bottom-#{margin_bottom}" if !margin_bottom.zero?

header_wrapper_classes << "govuk-!-padding-top-#{padding_top}" if padding_top.is_a? Numeric
Expand All @@ -14,34 +13,11 @@
%>

<div class="<%= header_wrapper_classes.join(' ') %>">
<%#
.browse__header-wrapper is a separate element to enable the govuk-chat
promo, once this is disabled we can remove this element and add the
".browse__header-wrapper" class back to the array of header_wrapper_classes
%>
<div class="browse__header-wrapper">
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="<%= column_classes.join(' ') %>">
<%= yield %>
</div>
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="<%= column_classes.join(' ') %>">
<%= yield %>
</div>
</div>
</div>

<% if govuk_chat_promo %>
<div class="browse__govuk-chat-promo">
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%= render "govuk_publishing_components/components/chat_entry", {
margin_bottom: 0,
heading_text: "Ask GOV.UK Chat about business and tax",
description_text: "Get quick, tailored answers with GOV.UK’s experimental AI chat",
} %>
</div>
</div>
</div>
</div>
<% end %>
</div>
18 changes: 5 additions & 13 deletions app/views/step_nav/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,19 @@
<meta name="description" content="<%= step_by_step.description %>">
<% end %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half govuk-grid-column-two-thirds-from-desktop">
<div class="govuk-grid-column-two-thirds">
<%= render 'govuk_publishing_components/components/title',
title: step_by_step.title,
average_title_length: 'long',
margin_bottom: 6 %>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half govuk-grid-column-two-thirds-from-desktop">
<%= render "govuk_publishing_components/components/govspeak", {
} do %>
<%= step_by_step.introduction %>
<% end %>

</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/step_by_step_nav", step_by_step.payload_for_component %>
</div>

<% if show_govuk_chat_promo?(step_by_step.base_path) %>
<div class="govuk-grid-column-one-half govuk-grid-column-one-third-from-desktop">
<%= render "govuk_publishing_components/components/chat_entry", { margin_top_until_tablet: true } %>
</div>
<% end %>
</div>
15 changes: 0 additions & 15 deletions spec/features/mainstream_browsing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,4 @@
expect(page).not_to have_css(".browse__action-links")
expect(page).not_to have_content("Most viewed")
end

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"] = "/browse/business"
end

stub_content_store_has_item(content_item["base_path"], content_item)
content_ids = content_item["links"]["second_level_browse_pages"].map { |link| link["content_id"] }
search_api_has_popular_documents_for_level_one_browse(content_ids)

ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do
visit content_item["base_path"]
expect(page).to have_selector(".gem-c-chat-entry")
end
end
end
13 changes: 0 additions & 13 deletions spec/features/step_nav_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@
expect(page).to have_title("#{content_item['title']} - GOV.UK")
end

it "renders the GOV.UK Chat promo" do
content_item = GovukSchemas::RandomExample.for_schema(frontend_schema: "step_by_step_nav")
["/set-up-limited-company", "/set-up-as-sole-trader"].each do |path|
content_item["base_path"] = path
stub_content_store_has_item(content_item["base_path"], content_item)

ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do
visit content_item["base_path"]
expect(page).to have_selector(".gem-c-chat-entry")
end
end
end

def step_nav_example
schema = GovukSchemas::Schema.find(frontend_schema: "step_by_step_nav")

Expand Down
21 changes: 0 additions & 21 deletions spec/helpers/govuk_chat_promo_helper_spec.rb

This file was deleted.

Loading