diff --git a/app/helpers/tab_nav_helper.rb b/app/helpers/tab_nav_helper.rb index 376424c7e..bc3e10f86 100644 --- a/app/helpers/tab_nav_helper.rb +++ b/app/helpers/tab_nav_helper.rb @@ -3,11 +3,11 @@ module TabNavHelper def user_cell(user) link_text = user.name.presence || user.email - [govuk_link_to(link_text, user, class: "govuk-!-font-weight-bold"), user.email].join("\n") + [govuk_link_to(link_text, user), "#{user.email}"].join("\n") end def org_cell(user) - role = "#{user.role.to_s.humanize}" + role = "#{user.role.to_s.humanize}" [user.organisation.name, role].join("\n") end diff --git a/app/views/organisations/_organisation_list.html.erb b/app/views/organisations/_organisation_list.html.erb index 383de6e95..a027718fa 100644 --- a/app/views/organisations/_organisation_list.html.erb +++ b/app/views/organisations/_organisation_list.html.erb @@ -6,16 +6,24 @@ <% end %> <%= table.head do |head| %> <%= head.row do |row| %> - <% row.cell(header: true, text: "Name") %> - <% row.cell(header: true, text: "Registration number") %> - <% row.cell(header: true, text: "Type") %> + <% row.cell(header: true, text: "Name", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Registration number", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Type", html_attributes: { + scope: "col", + }) %> <% end %> <% end %> <% @organisations.each do |organisation| %> <%= table.body do |body| %> <%= body.row do |row| %> - <% row.cell do %> - <%= govuk_link_to(organisation.name, "organisations/#{organisation.id}/logs", class: "govuk-!-font-weight-bold") %> + <% row.cell(header: true, html_attributes: { + scope: "row", + }) do %> + <%= govuk_link_to(organisation.name, "organisations/#{organisation.id}/logs") %> <% end %> <% row.cell(text: organisation.housing_registration_no) %> <% row.cell(text: display_provider_type(organisation.provider_type)) %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4ed96d2ad..e9bd62065 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -25,15 +25,23 @@ <% end %> <%= table.head do |head| %> <%= head.row do |row| %> - <% row.cell(header: true, text: "Name and email adress") %> - <% row.cell(header: true, text: "Organisation and role") %> - <% row.cell(header: true, text: "Last logged in") %> + <% row.cell(header: true, text: "Name and email adress", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Organisation and role", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Last logged in", html_attributes: { + scope: "col", + }) %> <% end %> <% end %> <% @users.each do |user| %> <%= table.body do |body| %> <%= body.row do |row| %> - <% row.cell do %> + <% row.cell(header: true, html_attributes: { + scope: "row", + }) do %> <%= simple_format(user_cell(user), {}, wrapper_tag: "span") %> <% if user.is_data_protection_officer? || user.is_key_contact? %>
diff --git a/spec/helpers/tab_nav_helper_spec.rb b/spec/helpers/tab_nav_helper_spec.rb index f8931de8e..4930d33b5 100644 --- a/spec/helpers/tab_nav_helper_spec.rb +++ b/spec/helpers/tab_nav_helper_spec.rb @@ -6,14 +6,14 @@ RSpec.describe TabNavHelper do describe "#user_cell" do it "returns user link and email separated by a newline character" do - expected_html = "Danny Rojas\n#{user.email}" + expected_html = "Danny Rojas\n#{user.email}" expect(user_cell(user)).to match(expected_html) end end describe "#org_cell" do it "returns the users org name and role separated by a newline character" do - expected_html = "DLUHC\nData provider" + expected_html = "DLUHC\nData provider" expect(org_cell(user)).to match(expected_html) end end