Skip to content

Commit

Permalink
Move support user primary nav to the service header
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie committed Oct 4, 2024
1 parent 80ced40 commit 3dca5f4
Show file tree
Hide file tree
Showing 71 changed files with 99 additions and 135 deletions.
5 changes: 4 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
<% header.with_product_name(name: service_name) %>
<% if current_user %>
<% header.with_navigation_item(text: t(".your_account"), href: account_path) %>
<%# header.with_navigation_item(text: t(".your_account"), href: account_path) %>
<% if current_user.support_user? && current_service == :placements %>
<%= render "placements/support/header_navigation", header: %>
<% end %>
<% header.with_navigation_item(text: t(".sign_out"), href: sign_out_path) %>
<% end %>
<% end %>
Expand Down
5 changes: 5 additions & 0 deletions app/views/placements/support/_header_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%# locals: (header:) %>
<% header.with_navigation_item(text: t(".organisations"), href: support_organisations_path, active: false) %>
<% header.with_navigation_item(text: t(".users"), href: support_support_users_path, active: false) %>
<% header.with_navigation_item(text: t(".settings"), href: placements_support_settings_path, active: false) %>
2 changes: 0 additions & 2 deletions app/views/placements/support/mailers/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<% render "placements/support/primary_navigation", current_navigation: :settings %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_settings_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/placements/support/organisations/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, t(".title", organisation_count: @pagy.count) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container" data-controller="filter">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand Down
2 changes: 1 addition & 1 deletion app/views/placements/support/providers/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :page_title, @provider_form.errors.any? ? t(".title_with_error") : t(".title") %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: new_placements_support_organisation_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= content_for :page_title, sanitize(@provider.name) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", provider_name: @provider.name, school_name: @partner_school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_provider_partner_school_path(@provider, @partner_school)) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", partner_school_name: @partner_school.name, provider_name: @provider.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_provider_partner_schools_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% else %>
<% content_for :page_title, t(".title", provider_count: providers.count, search_param:) %>
<% end %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: new_placements_support_provider_path) %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/placements/support/providers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= content_for :page_title, sanitize(@provider.name) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= content_for :page_title, sanitize(@provider.name) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", user_name: @user.full_name, organisation_name: @organisation.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_provider_user_path(@organisation, @user)) %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/placements/support/providers/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, sanitize("#{@user.full_name} - #{@provider.name}") %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_provider_users_path(@provider)) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", user_name: @mentor.full_name, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_mentor_path(school_id: @school.id, id: @mentor.id)) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", user_name: @mentor.full_name, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_mentor_path(school_id: @school.id, id: @mentor.id)) %>
<% end %>
Expand Down
2 changes: 0 additions & 2 deletions app/views/placements/support/schools/mentors/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(@school.name) %>

<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<h1 class="govuk-heading-l"><%= @school.name %></h1>

Expand Down
2 changes: 0 additions & 2 deletions app/views/placements/support/schools/mentors/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", mentor_name: @mentor.full_name, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_mentors_path) %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/placements/support/schools/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :page_title, @school_form.errors.any? ? t(".title_with_error") : t(".title") %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: new_placements_support_organisation_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= content_for :page_title, sanitize(@school.name) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", provider_name: @partner_provider.name, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_partner_provider_path(@school, @partner_provider)) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", partner_provider_name: @partner_provider.name, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_partner_providers_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", subject_names: @placement.title, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_placement_path(@school, @placement)) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", subject_names: @placement.title, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_placement_path(@school, @placement)) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :page_title, t(".page_title") %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<h1 class="govuk-heading-l"><%= @school.name %></h1>

Expand Down
2 changes: 0 additions & 2 deletions app/views/placements/support/schools/placements/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", placement_name: @placement.title, school_name: @school.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_placements_path) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<% content_for :page_title, t(".title", school_count: schools.count, search_param:) %>
<% end %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: new_placements_support_school_path) %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/placements/support/schools/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= content_for :page_title, sanitize(@school.name) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/placements/support/schools/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= content_for :page_title, sanitize(@school.name) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
2 changes: 1 addition & 1 deletion app/views/placements/support/schools/users/remove.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, sanitize(t(".page_title", user_name: @user.full_name, organisation_name: @organisation.name)) %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_user_path(@organisation, @user)) %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/placements/support/schools/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, sanitize("#{@user.full_name} - #{@school.name}") %>
<%= render "placements/support/primary_navigation", current_navigation: :organisations %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_school_users_path(@school)) %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/placements/support/settings/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%# content_for :page_title, t(".heading", records: @pagy.count) %>
<%= render "placements/support/primary_navigation", current_navigation: :settings %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<%= render "placements/support/primary_navigation", current_navigation: :users %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: back_link_path) %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/placements/support/support_users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<% content_for(:page_title) { t(".page_title") } %>
<%= render "placements/support/primary_navigation", current_navigation: :users %>

<div class="govuk-width-container">
<h1 class="govuk-heading-l"><%= t(".heading") %></h1>
Expand Down
2 changes: 0 additions & 2 deletions app/views/placements/support/support_users/remove.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<% content_for(:page_title) { t(".page_title", user_name: @support_user.full_name) } %>
<%= render "placements/support/primary_navigation", current_navigation: :users %>
<%= content_for(:before_content) do %>
<%= govuk_back_link(href: placements_support_support_user_path(@support_user)) %>
<% end %>
Expand Down
2 changes: 0 additions & 2 deletions app/views/placements/support/support_users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<% content_for(:page_title) { @support_user.full_name } %>
<%= render "placements/support/primary_navigation", current_navigation: :users %>
<% content_for(:before_content) do %>
<%= govuk_back_link href: placements_support_support_users_path %>
<% end %>
Expand Down
7 changes: 7 additions & 0 deletions config/locales/en/placements/support/header_navigation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
en:
placements:
support:
header_navigation:
users: Support users
organisations: Organisations
settings: Settings
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ def given_i_am_signed_in_as_a_support_user
end

def then_i_see_support_navigation_with_organisation_selected
within(".app-primary-navigation__nav") do
expect(page).to have_link "Organisations", current: "page"
expect(page).to have_link "Support users", current: "false"
within(".govuk-header__navigation-list") do
expect(page).to have_link "Organisations"
expect(page).to have_link "Support users"
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def when_i_click_add_organisation
end

def then_i_see_support_navigation_with_organisation_selected
within(".app-primary-navigation__nav") do
expect(page).to have_link "Organisations", current: "page"
expect(page).to have_link "Support users", current: "false"
within(".govuk-header__navigation-list") do
expect(page).to have_link "Organisations"
expect(page).to have_link "Support users"
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def when_i_visit_the_partner_schools_page_for(provider)
end

def then_i_see_support_navigation_with_organisation_selected
within(".app-primary-navigation__nav") do
expect(page).to have_link "Organisations", current: "page"
expect(page).to have_link "Support users", current: "false"
within(".govuk-header__navigation-list") do
expect(page).to have_link "Organisations"
expect(page).to have_link "Support users"
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def when_i_visit_the_add_partner_school_page_for(provider)
end

def then_i_see_support_navigation_with_organisation_selected
within(".app-primary-navigation__nav") do
expect(page).to have_link "Organisations", current: "page"
expect(page).to have_link "Support users", current: "false"
within(".govuk-header__navigation-list") do
expect(page).to have_link "Organisations"
expect(page).to have_link "Support users"
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def when_i_visit_the_partner_schools_page_for(provider:, school:)
end

def then_i_see_support_navigation_with_organisation_selected
within(".app-primary-navigation__nav") do
expect(page).to have_link "Organisations", current: "page"
expect(page).to have_link "Support users", current: "false"
within(".govuk-header__navigation-list") do
expect(page).to have_link "Organisations"
expect(page).to have_link "Support users"
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def then_i_see_the_details_for(school)
end

def then_i_see_support_navigation_with_organisation_selected
within(".app-primary-navigation__nav") do
expect(page).to have_link "Organisations", current: "page"
expect(page).to have_link "Support users", current: "false"
within(".govuk-header__navigation-list") do
expect(page).to have_link "Organisations"
expect(page).to have_link "Support users"
end
end

Expand Down
Loading

0 comments on commit 3dca5f4

Please sign in to comment.