Skip to content

Commit

Permalink
Replace hard coded account nav with layout header
Browse files Browse the repository at this point in the history
During development the account nav markup was copied over from the
layout header component instead of using the component itself.
This was probably due to time constraints.

The component audits are complaining that we are including the assets
for layout_header, when we are not using the component.

This removes the hard coded account navigation partial and uses
layout_header instead. This is technically duplicating the header, so
this change is dependent on some changes in Slimmer which will
conditionally reveal this layout header only when the account nav should
be present.
  • Loading branch information
danacotoran committed Feb 2, 2021
1 parent 7aeba73 commit 8bdb385
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
24 changes: 0 additions & 24 deletions app/views/root/_account_navigation.html.erb

This file was deleted.

34 changes: 30 additions & 4 deletions app/views/root/_base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,39 @@
} %>
</div>
</form>

<% unless hide_account_navigation %>
<%= render partial: 'account_navigation' %>
<% end %>
<% end %>

<% content_for :after_header do %>
<% unless hide_account_navigation %>
<%= render "govuk_publishing_components/components/layout_header", {
remove_bottom_border: true,
navigation_items: [
{
text: "Account",
href: Plek.new.find("account-manager"),
data: {
module: "explicit-cross-domain-links",
link_for: "accounts-signed-in",
},
},
{
text: "Sign out",
href: Plek.new.website_root + "/transition-check/logout",
data: {
module: "explicit-cross-domain-links",
link_for: "accounts-signed-in",
},
},
{
text: "Sign in",
href: Plek.new.website_root + "/transition-check/login",
data: {
module: "explicit-cross-domain-links",
link_for: "accounts-signed-out",
},
}],
} %>
<% end %>
<div id="user-satisfaction-survey-container"></div>
<% if @emergency_banner %>
<%= render "notifications/emergency_banner", banner: @emergency_banner %>
Expand Down

0 comments on commit 8bdb385

Please sign in to comment.