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

Make Product name customisable #561

Merged
merged 1 commit into from Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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