From 37ff77f42488d91b25bf7c83eba6a1d975473d2d Mon Sep 17 00:00:00 2001 From: J G <7750475+moarpheus@users.noreply.github.com> Date: Mon, 6 Jun 2022 17:23:47 +0100 Subject: [PATCH] Fix sub nav (#642) * fixed sub nav * fixed titles for non sup * fixed title for coord * fixed title for coordin * lint --- app/views/case_logs/index.html.erb | 2 +- app/views/organisations/logs.html.erb | 4 ++-- app/views/organisations/show.html.erb | 6 +++--- app/views/organisations/users.html.erb | 4 ++-- app/views/users/index.html.erb | 2 +- spec/requests/case_logs_controller_spec.rb | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/case_logs/index.html.erb b/app/views/case_logs/index.html.erb index 0580e18a9..c59d4f255 100644 --- a/app/views/case_logs/index.html.erb +++ b/app/views/case_logs/index.html.erb @@ -2,7 +2,7 @@ <% if @searched.present? %> <% title = "#{current_user.support? ? 'Logs' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’)" %> <% else %> - <% title = current_user.support? ? "Logs" : "#{current_user.organisation.name} (Logs)" %> + <% title = "Logs" %> <% end %> <% content_for :title, title %> diff --git a/app/views/organisations/logs.html.erb b/app/views/organisations/logs.html.erb index 074fe3296..e9230f3e7 100644 --- a/app/views/organisations/logs.html.erb +++ b/app/views/organisations/logs.html.erb @@ -11,12 +11,12 @@

<%= @organisation.name %>

-

Logs

- <%= render SubNavigationComponent.new( items: secondary_items(request.path, @organisation.id), ) %> +

Logs

+
<%= render partial: "case_logs/log_filters" %>
diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb index 93f6ca76a..c148f08d4 100644 --- a/app/views/organisations/show.html.erb +++ b/app/views/organisations/show.html.erb @@ -1,4 +1,4 @@ -<% title = "#{@organisation.name} (Organisation details)" %> +<% title = current_user.support? ? "#{@organisation.name} (Organisation details)" : "Organisation details" %> <% content_for :title, title %>

@@ -10,14 +10,14 @@ <% end %>

-

About this organisation

- <% if current_user.support? %> <%= render SubNavigationComponent.new( items: secondary_items(request.path, @organisation.id), ) %> <% end %> +

About this organisation

+
<%= govuk_summary_list do |summary_list| %> diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index 6d846c29c..1776bc4cd 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -13,12 +13,12 @@ <% end %> -

Users

- <%= render SubNavigationComponent.new( items: secondary_items(request.path, @organisation.id), ) %> +

Users

+ <% if current_user.data_coordinator? || current_user.support? %> <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> <% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 7bd9b9be5..81e4c3fa0 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -2,7 +2,7 @@ <% if @searched.present? %> <% title = "#{current_user.support? ? 'Users' : current_user.organisation.name} (#{@pagy.count} #{item_label} matching ‘#{@searched}’" %> <% else %> - <% title = current_user.support? ? "Users" : "#{current_user.organisation.name} (Users)" %> + <% title = "Users" %> <% end %> <% content_for :title, title %> diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb index 6c5a0185b..6f3275128 100644 --- a/spec/requests/case_logs_controller_spec.rb +++ b/spec/requests/case_logs_controller_spec.rb @@ -466,7 +466,7 @@ RSpec.describe CaseLogsController, type: :request do end it "does not have pagination in the title" do - expect(page).to have_title("#{user.organisation.name} (Logs) - Submit social housing lettings and sales data (CORE) - GOV.UK") + expect(page).to have_title("Logs - Submit social housing lettings and sales data (CORE) - GOV.UK") end it "shows the download csv link" do @@ -542,7 +542,7 @@ RSpec.describe CaseLogsController, type: :request do end it "has pagination in the title" do - expect(page).to have_title("#{user.organisation.name} (Logs) (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") + expect(page).to have_title("Logs (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") end end @@ -567,7 +567,7 @@ RSpec.describe CaseLogsController, type: :request do end it "has pagination in the title" do - expect(page).to have_title("#{user.organisation.name} (Logs) (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") + expect(page).to have_title("Logs (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") end end end