Skip to content

Commit

Permalink
Merge pull request #3630 from alphagov/2615-remove-a-b-test-and-rever…
Browse files Browse the repository at this point in the history
…t-list-pr-s-m

Remove A/B test and revert list PR
  • Loading branch information
unoduetre committed May 28, 2024
2 parents fe42321 + 43f2fac commit ccb0cc0
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 225 deletions.
75 changes: 1 addition & 74 deletions app/assets/stylesheets/views/_browse.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import "govuk_publishing_components/individual_component_support";
@import "govuk_publishing_components/components/mixins/prefixed-transform";

// This dark grey is the background colour for the browse pages.
//
Expand Down Expand Up @@ -87,76 +86,4 @@ $browse-header-background-colour: #263135;
@include govuk-media-query($from: "tablet") {
margin-bottom: govuk-spacing(6);
}
}

// chevron-card added from `frontend` for A/B testing
.browse__chevron-cards {
list-style: none;
padding: 0;
margin-top: 0;
}

.chevron-card {
border-top: 1px solid $govuk-border-colour;
padding: govuk-spacing(1) 0 govuk-spacing(4);

&:last-child {
border-bottom: 1px solid $govuk-border-colour;
}
}

.chevron-card__wrapper {
padding: 19px 0 4px;
position: relative;

.govuk-heading-s,
.chevron-card__description {
margin: 0 govuk-spacing(6) 0 0;

// Ensure card content width is constrained to two thirds on desktop
@include govuk-media-query($from: "desktop") {
max-width: 66.6667%;
}
}
}

.chevron-card__link {
&::after {
bottom: 0;
content: "";
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
}

&::before {
$dimension: 7px;
$width: 3px;

border-right: $width solid $govuk-brand-colour;
border-top: $width solid $govuk-brand-colour;
content: "";
display: block;
height: $dimension;
position: absolute;
right: govuk-spacing(1);
top: 50%;
margin-top: 5px;
@include prefixed-transform($rotate: 45deg);
width: $dimension;
}

&:hover {
&::before {
border-color: $govuk-link-hover-colour;
}
}

&:focus {
&::before {
border-color: $govuk-focus-text-colour;
}
}
}
}
3 changes: 0 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
class ApplicationController < ActionController::Base
include Slimmer::Template
include NewBrowseAbTestable

helper_method :new_browse_variant
helper_method :content_item_h
helper_method :new_browse_page_under_test?

protect_from_forgery with: :exception

Expand Down
5 changes: 0 additions & 5 deletions app/controllers/browse_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class BrowseController < ApplicationController
include NewBrowseAbTestable
slimmer_template "gem_layout_full_width"

def index
Expand All @@ -11,8 +10,6 @@ def index
end

def show
set_new_browse_response_header if new_browse_page_under_test?

page = MainstreamBrowsePage.find("/browse/#{params[:top_level_slug]}")
setup_content_item_and_navigation_helpers(page)

Expand All @@ -21,8 +18,6 @@ def show

private

helper_method :new_browse_variant_b?

def show_html(page)
template = :show
render template, locals: { page: }
Expand Down
31 changes: 0 additions & 31 deletions app/controllers/new_browse_ab_testable.rb

This file was deleted.

30 changes: 0 additions & 30 deletions app/views/browse/_browse_grid.html.erb

This file was deleted.

28 changes: 0 additions & 28 deletions app/views/browse/_browse_list.html.erb

This file was deleted.

22 changes: 0 additions & 22 deletions app/views/browse/_chevron_card.html.erb

This file was deleted.

35 changes: 30 additions & 5 deletions app/views/browse/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,35 @@
</div>
<% end %>
<% total_links = page.second_level_browse_pages.count.to_s %>
<%= render "shared/browse_cards_container" do %>
<% if new_browse_variant_b? %>
<%= render partial: "browse/browse_list", locals: { page: page } %>
<% else %>
<%= render partial: "browse/browse_grid", locals: { page: page } %>
<% end %>
<%= render "govuk_publishing_components/components/cards", {
items: page.second_level_browse_pages.map.with_index do |second_level_browse_page, index|
{
link: {
text: second_level_browse_page.title,
path: second_level_browse_page.base_path,
data_attributes: {
track_category: "browseClicked",
track_action: "topicsLink",
track_label: second_level_browse_page.base_path,
track_dimension: second_level_browse_page.title,
track_options: {
dimension28: total_links,
dimension29: second_level_browse_page.title,
dimension114: index + 1,
},
ga4_link: {
event_name: "navigation",
type: "browse card",
index_link: index + 1,
index_total: total_links,
},
},
},
description: second_level_browse_page.description,
}
end,
sub_heading_level: display_action_links_for_slug?(page.slug) ? 3 : 2,
} %>
<% end %>
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= yield :meta_tags %>
<%= new_browse_variant.analytics_meta_tag.html_safe if new_browse_page_under_test? %>
<%= render 'govuk_publishing_components/components/meta_tags', content_item: content_item_h %>
<%=
render_component_stylesheets
Expand Down
26 changes: 0 additions & 26 deletions spec/controllers/browse_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

expect(response.headers["Cache-Control"]).to eq("max-age=300, public")
end

it "is not included in the newbrowse AB test" do
assert_response_not_modified_for_ab_test("NewBrowse")
end
end

describe "GET top_level_browse_page" do
Expand All @@ -46,28 +42,6 @@
expect(response.content_type).to eq "text/html; charset=utf-8"
expect(response).to render_template(partial: "_cards")
end

context "NewBrowse AB test" do
subject { get :show, params: { top_level_slug: "benefits" } }

it "with variant A" do
with_variant NewBrowse: "A" do
expect(subject).to render_template(partial: "_browse_grid")
end
end

it "with variant B" do
with_variant NewBrowse: "B" do
expect(subject).to render_template(partial: "_browse_list")
end
end

it "with variant Z" do
with_variant NewBrowse: "Z" do
expect(subject).to render_template(partial: "_browse_grid")
end
end
end
end

it "404 if the browse page does not exist" do
Expand Down

0 comments on commit ccb0cc0

Please sign in to comment.