diff --git a/app/helpers/components/table_helper.rb b/app/helpers/components/table_helper.rb index 982601420..fe47237ec 100644 --- a/app/helpers/components/table_helper.rb +++ b/app/helpers/components/table_helper.rb @@ -50,6 +50,7 @@ def row def header(str, opt = {}) classes = %w[govuk-table__header] + classes << opt[:classes] if opt[:classes] classes << "govuk-table__header--#{opt[:format]}" if opt[:format] classes << "govuk-table__header--active" if opt[:sort_direction] link_classes = %w[app-table__sort-link] diff --git a/app/views/account/applications/index.html.erb b/app/views/account/applications/index.html.erb index 46e275894..e851107cb 100644 --- a/app/views/account/applications/index.html.erb +++ b/app/views/account/applications/index.html.erb @@ -29,8 +29,8 @@ <%= render "components/table", { caption: "Apps you have access to", head: [ - { text: "Name" }, - { text: "Description" }, + { text: "Name", classes: "govuk-!-width-one-quarter" }, + { text: "Description", classes: "govuk-!-width-one-third" }, { text: content_tag(:span, "Actions", class: "govuk-visually-hidden") }, ], rows: @applications_with_signin.map do |application| @@ -47,8 +47,8 @@ <%= render "components/table", { caption: "Apps you don't have access to", head: [ - { text: "Name" }, - { text: "Description" }, + { text: "Name", classes: "govuk-!-width-one-quarter" }, + { text: "Description", classes: "govuk-!-width-one-third" }, { text: content_tag(:span, "Actions", class: "govuk-visually-hidden") } ], rows: @applications_without_signin.map do |application| diff --git a/app/views/api_users/applications/index.html.erb b/app/views/api_users/applications/index.html.erb index e15f35476..0b59d98ce 100644 --- a/app/views/api_users/applications/index.html.erb +++ b/app/views/api_users/applications/index.html.erb @@ -34,8 +34,8 @@ <%= render "components/table", { caption: "Apps #{@api_user.name} has access to", head: [ - { text: "Name" }, - { text: "Description" }, + { text: "Name", classes: "govuk-!-width-one-quarter" }, + { text: "Description", classes: "govuk-!-width-one-third" }, { text: content_tag(:span, "Actions", class: "govuk-visually-hidden") }, ], rows: @applications.map do |application| diff --git a/app/views/components/_table.html.erb b/app/views/components/_table.html.erb index 5ec626729..930abb54a 100644 --- a/app/views/components/_table.html.erb +++ b/app/views/components/_table.html.erb @@ -27,6 +27,7 @@ <%= t.head do %> <% head.each_with_index do |item, cellindex| %> <%= t.header item[:text], { + classes: item[:classes], format: item[:format], href: item[:href], data_attributes: item[:data_attributes], diff --git a/app/views/users/applications/index.html.erb b/app/views/users/applications/index.html.erb index 854d7431e..33bb21726 100644 --- a/app/views/users/applications/index.html.erb +++ b/app/views/users/applications/index.html.erb @@ -34,8 +34,8 @@ <%= render "components/table", { caption: "Apps #{@user.name} has access to", head: [ - { text: "Name" }, - { text: "Description" }, + { text: "Name", classes: "govuk-!-width-one-quarter" }, + { text: "Description", classes: "govuk-!-width-one-third" }, { text: content_tag(:span, "Actions", class: "govuk-visually-hidden") }, ], rows: @applications_with_signin.map do |application| @@ -52,8 +52,8 @@ <%= render "components/table", { caption: "Apps #{@user.name} does not have access to", head: [ - { text: "Name" }, - { text: "Description" }, + { text: "Name", classes: "govuk-!-width-one-quarter" }, + { text: "Description", classes: "govuk-!-width-one-third" }, { text: content_tag(:span, "Actions", class: "govuk-visually-hidden") } ], rows: @applications_without_signin.map do |application|