Skip to content

Commit

Permalink
Remove left search variant of layout header
Browse files Browse the repository at this point in the history
As it is no longer in use.
  • Loading branch information
AshGDS committed Sep 19, 2024
1 parent 811c591 commit d74d7f5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 87 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
useful summary for people upgrading their application, not a replication
of the commit log.

## Unreleased

* Remove left search variant of layout header ([PR #4239](https://github.com/alphagov/govuk_publishing_components/pull/4239))

## 43.3.0

* Remove unused cookies from cookie category ([PR #4234](https://github.com/alphagov/govuk_publishing_components/pull/4234))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,34 @@
product_name ||= nil
remove_bottom_border ||= false
search ||= false
search_left ||= false
width_class = full_width ? "govuk-header__container--full-width" : "govuk-width-container"
logo_link ||= "/"

header_classes = %w[gem-c-layout-header govuk-header]
header_classes << "gem-c-layout-header--#{environment}" if environment
header_classes << "gem-c-layout-header--no-bottom-border" if remove_bottom_border
header_classes << "gem-c-layout-header--search-left" if search_left
%>

<header class="<%= header_classes.join(' ') %>" role="banner" data-module="govuk-header">
<div class="govuk-header__container <%= width_class %>">
<% if search_left %>
<div class="govuk-grid-row">
<div class="gem-c-layout-header__logo govuk-grid-column-one-third-from-desktop">
<%= render "govuk_publishing_components/components/layout_header/header_logo", {
environment: environment,
logo_link: logo_link,
product_name: product_name,
} %>
</div>
<div class="govuk-grid-row">
<div class="gem-c-layout-header__logo govuk-grid-column-one-half">
<%= render "govuk_publishing_components/components/layout_header/header_logo", {
environment: environment,
logo_link: logo_link,
product_name: product_name,
} %>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-grid-column-one-third-from-desktop gem-c-layout-header__search govuk-!-display-none-print">
<%= render "govuk_publishing_components/components/layout_header/search" %>
<% if navigation_items.any? %>
<div class="govuk-header__content gem-c-header__content govuk-grid-column-full govuk-!-display-none-print">
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
</div>
<% if navigation_items.any? %>
<div class="govuk-header__content gem-c-header__content govuk-grid-column-full govuk-!-display-none-print">
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
</div>
<% end %>
</div>
<% else %>
<div class="govuk-grid-row">
<div class="gem-c-layout-header__logo govuk-grid-column-one-half">
<%= render "govuk_publishing_components/components/layout_header/header_logo", {
environment: environment,
logo_link: logo_link,
product_name: product_name,
} %>
<% end %>
<% if search %>
<div class="govuk-grid-column-one-half gem-c-layout-header__search govuk-!-display-none-print">
<%= render "govuk_publishing_components/components/layout_header/search" %>
</div>
<% if navigation_items.any? %>
<div class="govuk-header__content gem-c-header__content govuk-grid-column-full govuk-!-display-none-print">
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
</div>
<% end %>
<% if search %>
<div class="govuk-grid-column-one-half gem-c-layout-header__search govuk-!-display-none-print">
<%= render "govuk_publishing_components/components/layout_header/search" %>
</div>
<% end %>
</div>
<% end %>
<% end %>
</div>
</div>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,6 @@ examples:
- text: Hidden on desktop
href: "item-3"
show_only_in_collapsed_menu: true
with_left_search_and_navigation:
description: This supports pages where the search appears on the left with multiple navigation links on the right, such as the [How government works](https://www.gov.uk/government/how-government-works) page
data:
search_left: true
navigation_items:
- text: Departments
href: "item-1"
- text: Worldwide
href: "item-2"
- text: How government works
href: "item-3"
- text: Get involved
href: "item-4"
- text: Consultations
href: "item-4"
- text: Statistics
href: "item-5"
- text: News and communications
href: "item-6"
active: true
with_custom_navigation_aria_label:
description: The navigation has `aria-label="Top level"` by default. This option is here for when the `aria-label` needs to be more descriptive than that.
data:
search_left: true
navigation_aria_label: "Departments and policy"
navigation_items:
- text: Departments
href: "item-1"
- text: Worldwide
href: "item-2"
- text: How government works
href: "item-3"
- text: Get involved
href: "item-4"
- text: Consultations
href: "item-4"
- text: Statistics
href: "item-5"
- text: News and communications
href: "item-6"
active: true
with_navigation_link_data_attributes:
description: Supports adding data attributes i.e for tracking
data:
Expand Down
6 changes: 0 additions & 6 deletions spec/components/layout_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ def component_name
assert_select ".gem-c-layout-header .gem-c-search"
end

it "renders the search bar on the left when requested" do
render_component(environment: "public", search: true, search_left: true)

assert_select ".gem-c-layout-header--search-left"
end

it "has the default logo link when no logo_link is specified" do
render_component({})

Expand Down

0 comments on commit d74d7f5

Please sign in to comment.