Skip to content

Commit

Permalink
Merge pull request #561 from alphagov/header
Browse files Browse the repository at this point in the history
Make Product name customisable
  • Loading branch information
tijmenb committed Oct 4, 2018
2 parents 5514d0d + b79edce commit 92b009e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,9 @@
## Unreleased

* Fix toggle behaviour in related navigation and taxonomy navigation when JS disabled (PR #551)
* Make "GOV.UK Publishing" the default product name (PR #557 #561)
* Change the colour of production to red (PR #557)
* Add environment tag in the header for all environments (PR #557)

## 11.1.0

Expand Down
@@ -1,4 +1,5 @@
<%
product_name ||= "Publishing"
navigation_items ||= []
%>
<header class="gem-c-layout-header govuk-header gem-c-layout-header--<%= environment %>" role="banner" data-module="header">
Expand All @@ -19,7 +20,7 @@
</span>

<span class="govuk-header__product-name">
Publishing
<%= product_name %>
</span>

<span class="gem-c-environment-tag govuk-tag gem-c-environment-tag--<%= environment %>">
Expand Down
Expand Up @@ -19,6 +19,10 @@ examples:
development_environment:
data:
environment: development
with_product_name:
data:
environment: production
product_name: Product
with_navigation:
data:
environment: production
Expand Down
6 changes: 6 additions & 0 deletions spec/components/layout_header_spec.rb
Expand Up @@ -17,6 +17,12 @@ def component_name
assert_select ".govuk-header.gem-c-layout-header--staging"
end

it "renders the product name" do
render_component(environment: "staging", product_name: "Product name")

assert_select ".govuk-header__product-name", text: "Product name"
end

it "renders the header with navigation items" do
navigation_items = [
{ text: "Foo", href: "/foo", active: true },
Expand Down

0 comments on commit 92b009e

Please sign in to comment.