Skip to content

Commit

Permalink
Add the environment indicator to header
Browse files Browse the repository at this point in the history
This adds the environment indicator (staging, integration, development)
to the header. From user research we've seen that it might prevent
confusion, especially because we currently show the tag in all
interfaces.

Note that we're not adding this to production, which won't have any
overridden styling.

https://trello.com/c/05wMNlxg
  • Loading branch information
tijmenb committed Oct 2, 2018
1 parent 74790d3 commit 700ad7e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
Expand Up @@ -10,3 +10,22 @@
.gem-c-layout-header--test .govuk-header__container {
border-bottom-color: govuk-colour("grey-1");
}

.govuk-header__logo {
white-space: nowrap;
}

.gem-c-environment-tag {
vertical-align: text-bottom;
margin-left: 3px;
}

.gem-c-environment-tag--development {
background-color: govuk-colour("grey-1");
}

.gem-c-environment-tag--staging,
.gem-c-environment-tag--integration {
background-color: govuk-colour("yellow");
color: govuk-colour("black");
}
Expand Up @@ -18,12 +18,19 @@
GOV.UK
</span>
</span>

<% if product_name %>
<span class="govuk-header__product-name">
<%= product_name %>
</span>
<% end %>
</a>

<% unless environment == "production" %>
<span class="gem-c-environment-tag govuk-tag gem-c-environment-tag--<%= environment %>">
<%= environment %>
</span>
<% end %>
</div><div class="govuk-header__content">

<% if navigation_items.any? %>
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/app/views/layouts/dummy_admin_layout.html.erb
@@ -1,4 +1,4 @@
<% environment = "production" %>
<% environment = %w[development production staging integration].sample %>
<%= render 'govuk_publishing_components/components/layout_for_admin', {
environment: environment,
Expand All @@ -7,7 +7,7 @@
<%= render "govuk_publishing_components/components/skip_link" %>
<%= render "govuk_publishing_components/components/layout_header", {
environment: environment,
product_name: "Admin",
product_name: "Publishing",
navigation_items: [
{text: "John Doe", href: "#profile"},
{text: "Log out", href: "#logout"}
Expand Down

0 comments on commit 700ad7e

Please sign in to comment.