Skip to content

Commit

Permalink
Merge pull request #2988 from alphagov/fix-applications-table-column-…
Browse files Browse the repository at this point in the history
…alignment

Fix applications tables column alignment
  • Loading branch information
yndajas authored Jun 28, 2024
2 parents 1e2d2e4 + 6092dc1 commit 7145e07
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/helpers/components/table_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions app/views/account/applications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,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|
Expand All @@ -49,8 +49,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|
Expand Down
4 changes: 2 additions & 2 deletions app/views/api_users/applications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,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|
Expand Down
1 change: 1 addition & 0 deletions app/views/components/_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
8 changes: 4 additions & 4 deletions app/views/users/applications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,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|
Expand All @@ -53,8 +53,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|
Expand Down

0 comments on commit 7145e07

Please sign in to comment.