diff --git a/Gemfile b/Gemfile
index d7b7a30b6..7e55dd78c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -17,7 +17,7 @@ gem "dfe-autocomplete",
github: "DFE-Digital/dfe-autocomplete"
gem "faraday", "~> 2.9"
gem "gds_zendesk"
-gem "govuk-components", "~> 3.3.0"
+gem "govuk-components", "~> 5.0.0"
gem "govuk_design_system_formbuilder"
gem "govuk_markdown", "~> 2.0"
gem "jsbundling-rails"
@@ -26,7 +26,6 @@ gem "mail-notify"
gem "okcomputer", "~> 1.18"
gem "omniauth-oauth2", "~> 1.8"
gem "omniauth-rails_csrf_protection"
-gem "pagy"
gem "pg", "~> 1.5"
gem "puma", "~> 6.4"
gem "rack-attack"
@@ -36,7 +35,6 @@ gem "sidekiq"
gem "sidekiq-cron", "~> 1.10"
gem "sprockets-rails"
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
-gem "view_component"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index 7f06721e0..90a7e093d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -186,15 +186,15 @@ GEM
zendesk_api (~> 1.27)
globalid (1.2.1)
activesupport (>= 6.1)
- govuk-components (3.3.0)
- html-attributes-utils (~> 0.9, >= 0.9.2)
- pagy (~> 5.10.1)
- view_component (~> 2.74.1)
- govuk_design_system_formbuilder (3.3.0)
+ govuk-components (5.0.2)
+ html-attributes-utils (~> 1.0.0, >= 1.0.0)
+ pagy (~> 6.0)
+ view_component (>= 3.9, < 3.10)
+ govuk_design_system_formbuilder (5.0.0)
actionview (>= 6.1)
activemodel (>= 6.1)
activesupport (>= 6.1)
- html-attributes-utils (~> 0.9, >= 0.9.2)
+ html-attributes-utils (~> 1)
govuk_markdown (2.0.1)
activesupport
redcarpet
@@ -204,7 +204,7 @@ GEM
tilt
hashdiff (1.0.1)
hashie (5.0.0)
- html-attributes-utils (0.9.2)
+ html-attributes-utils (1.0.2)
activesupport (>= 6.1.4.4)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
@@ -287,8 +287,7 @@ GEM
actionpack (>= 4.2)
omniauth (~> 2.0)
orm_adapter (0.5.0)
- pagy (5.10.1)
- activesupport
+ pagy (6.4.3)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
@@ -492,8 +491,8 @@ GEM
uri (0.13.0)
vcr (6.2.0)
version_gem (1.1.1)
- view_component (2.74.1)
- activesupport (>= 5.0.0, < 8.0)
+ view_component (3.9.0)
+ activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
warden (1.2.9)
@@ -525,6 +524,7 @@ GEM
PLATFORMS
arm64-darwin-21
+ arm64-darwin-23
x86_64-darwin-21
x86_64-linux
@@ -548,7 +548,7 @@ DEPENDENCIES
faraday (~> 2.9)
foreman (~> 0.87.2)
gds_zendesk
- govuk-components (~> 3.3.0)
+ govuk-components (~> 5.0.0)
govuk_design_system_formbuilder
govuk_markdown (~> 2.0)
jsbundling-rails
@@ -557,7 +557,6 @@ DEPENDENCIES
okcomputer (~> 1.18)
omniauth-oauth2 (~> 1.8)
omniauth-rails_csrf_protection
- pagy
pg (~> 1.5)
prettier_print (~> 1.2.1)
puma (~> 6.4)
@@ -582,7 +581,6 @@ DEPENDENCIES
syntax_tree-rbs (~> 1.0.0)
tzinfo-data
vcr (~> 6.2)
- view_component
web-console
webmock (~> 3.18)
diff --git a/app/components/flash_message_component.html.erb b/app/components/flash_message_component.html.erb
index 0c86f1c24..62227cae4 100644
--- a/app/components/flash_message_component.html.erb
+++ b/app/components/flash_message_component.html.erb
@@ -3,6 +3,6 @@
classes: classes,
html_attributes: { role: role },
) do |notification_banner| %>
- <% notification_banner.heading(text: heading) %>
+ <% notification_banner.with_heading(text: heading) %>
<%= body %>
<% end %>
diff --git a/app/components/journeys_performance_table_component.rb b/app/components/journeys_performance_table_component.rb
index 8d9e9b191..b04074395 100644
--- a/app/components/journeys_performance_table_component.rb
+++ b/app/components/journeys_performance_table_component.rb
@@ -9,23 +9,23 @@ def initialize(which_questions_were_needed)
def call
govuk_table(classes: "app-performance-table") do |table|
- table.caption(
+ table.with_caption(
size: "m",
text: "Journeys through Find a lost TRN (today and the last 7 days)",
)
- table.head do |head|
- head.row do |row|
- row.cell(header: true, text: "Number of questions asked")
- row.cell(header: true, text: "Number of users")
+ table.with_head do |head|
+ head.with_row do |row|
+ row.with_cell(header: true, text: "Number of questions asked")
+ row.with_cell(header: true, text: "Number of users")
end
end
- table.body do |body|
- body.row do |row|
- row.cell do
+ table.with_body do |body|
+ body.with_row do |row|
+ row.with_cell do
'3 questions
Email address, name and date of birth'.html_safe
end
- row.cell do
+ row.with_cell do
number_with_percentage_cell(
@which_questions_were_needed,
:three_questions,
@@ -33,11 +33,11 @@ def call
)
end
end
- body.row do |row|
- row.cell do
+ body.with_row do |row|
+ row.with_cell do
'4 questions
+ National Insurance number'.html_safe
end
- row.cell do
+ row.with_cell do
number_with_percentage_cell(
@which_questions_were_needed,
:four_questions,
@@ -45,11 +45,11 @@ def call
)
end
end
- body.row do |row|
- row.cell do
+ body.with_row do |row|
+ row.with_cell do
'5 questions (with a match)
+ ITT provider'.html_safe
end
- row.cell do
+ row.with_cell do
number_with_percentage_cell(
@which_questions_were_needed,
:five_questions_matched,
@@ -57,11 +57,11 @@ def call
)
end
end
- body.row do |row|
- row.cell do
+ body.with_row do |row|
+ row.with_cell do
'5 questions (without a match)
+ ITT provider'.html_safe
end
- row.cell do
+ row.with_cell do
number_with_percentage_cell(
@which_questions_were_needed,
:five_questions_nomatch,
diff --git a/app/components/trn_requests_performance_table_component.rb b/app/components/trn_requests_performance_table_component.rb
index 20dcc237c..fa92ed718 100644
--- a/app/components/trn_requests_performance_table_component.rb
+++ b/app/components/trn_requests_performance_table_component.rb
@@ -11,60 +11,60 @@ def initialize(grouped_request_counts:, total_grouped_requests:, since:)
def call
govuk_table(classes: "app-performance-table") do |table|
- table.head do |head|
- head.row do |row|
- row.cell(
+ table.with_head do |head|
+ head.with_row do |row|
+ row.with_cell(
header: true,
text: "Date",
classes:
"app-performance-table-column-divider app-performance-table-date-column",
)
- row.cell(header: true, text: "TRN found")
- row.cell(header: true, text: "No match")
- row.cell(
+ row.with_cell(header: true, text: "TRN found")
+ row.with_cell(header: true, text: "No match")
+ row.with_cell(
header: true,
text: "Did not finish",
classes: "app-performance-table-column-divider",
)
- row.cell(
+ row.with_cell(
header: true,
text: "Total",
classes: "govuk-!-padding-left-2",
)
end
end
- table.body do |body|
+ table.with_body do |body|
@grouped_request_counts.map do |period_label, counts|
- body.row do |row|
- row.cell(classes: "app-performance-table-column-divider") do
+ body.with_row do |row|
+ row.with_cell(classes: "app-performance-table-column-divider") do
period_label
end
- row.cell { number_with_percentage_cell(counts, :cnt_trn_found) }
- row.cell { number_with_percentage_cell(counts, :cnt_no_match) }
- row.cell(classes: "app-performance-table-column-divider") do
+ row.with_cell { number_with_percentage_cell(counts, :cnt_trn_found) }
+ row.with_cell { number_with_percentage_cell(counts, :cnt_no_match) }
+ row.with_cell(classes: "app-performance-table-column-divider") do
number_with_percentage_cell(counts, :cnt_did_not_finish)
end
- row.cell { "#{number_with_delimiter(counts[:total])} requests" }
+ row.with_cell { "#{number_with_delimiter(counts[:total])} requests" }
end
end
- body.row(classes: "app-performance-table-total-row") do |row|
- row.cell(
+ body.with_row(classes: "app-performance-table-total-row") do |row|
+ row.with_cell(
header: true,
classes: "app-performance-table-column-divider",
) { "Total (#{@since})" }
- row.cell do
+ row.with_cell do
number_with_percentage_cell(@total_grouped_requests, :cnt_trn_found)
end
- row.cell do
+ row.with_cell do
number_with_percentage_cell(@total_grouped_requests, :cnt_no_match)
end
- row.cell(classes: "app-performance-table-column-divider") do
+ row.with_cell(classes: "app-performance-table-column-divider") do
number_with_percentage_cell(
@total_grouped_requests,
:cnt_did_not_finish,
)
end
- row.cell do
+ row.with_cell do
"#{number_with_delimiter(@total_grouped_requests[:total])} requests"
end
end
diff --git a/app/components/zendesk_delete_requests_performance_table_component.rb b/app/components/zendesk_delete_requests_performance_table_component.rb
index a80f0cc11..d0e5f514d 100644
--- a/app/components/zendesk_delete_requests_performance_table_component.rb
+++ b/app/components/zendesk_delete_requests_performance_table_component.rb
@@ -6,39 +6,39 @@ class ZendeskDeleteRequestsPerformanceTableComponent < ViewComponent::Base
def call
govuk_table(classes: "app-performance-table") do |table|
- table.head do |head|
- head.row do |row|
- row.cell(
+ table.with_head do |head|
+ head.with_row do |row|
+ row.with_cell(
header: true,
text: "Date",
classes:
"app-performance-table-column-divider app-performance-table-date-column",
)
- row.cell(
+ row.with_cell(
header: true,
text: "Total",
classes: "govuk-!-padding-left-2",
)
end
end
- table.body do |body|
+ table.with_body do |body|
grouped_request_counts.map do |period_label, counts|
- body.row do |row|
- row.cell(classes: "app-performance-table-column-divider") do
+ body.with_row do |row|
+ row.with_cell(classes: "app-performance-table-column-divider") do
period_label
end
- row.cell do
+ row.with_cell do
"#{number_with_delimiter(counts[:total])} delete requests"
end
end
end
- body.row(classes: "app-performance-table-total-row") do |row|
- row.cell(
+ body.with_row(classes: "app-performance-table-total-row") do |row|
+ row.with_cell(
header: true,
classes: "app-performance-table-column-divider",
) { "Total (#{since})" }
- row.cell do
+ row.with_cell do
"#{number_with_delimiter(total_grouped_requests[:total])} delete requests"
end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c5dc11a9c..b78570aa5 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -42,47 +42,47 @@ def custom_header
) do |header|
case try(:current_namespace)
when "support_interface"
- header.navigation_item(
+ header.with_navigation_item(
active: current_page?(support_interface_trn_requests_path),
href: support_interface_trn_requests_path,
text: "TRNs",
)
- header.navigation_item(
+ header.with_navigation_item(
active: current_page?(support_interface_features_path),
href: support_interface_features_path,
text: "Features",
)
- header.navigation_item(
+ header.with_navigation_item(
active:
request.path.start_with?("/support/identity") ||
request.path.start_with?("/support/dqt_record"),
href: support_interface_identity_user_index_path,
text: "Identity",
)
- header.navigation_item(
+ header.with_navigation_item(
active: request.path.start_with?("/support/staff"),
href: support_interface_staff_index_path,
text: "Staff",
)
- header.navigation_item(
+ header.with_navigation_item(
active: false,
href: support_interface_sidekiq_web_path,
text: "Sidekiq",
)
- header.navigation_item(
+ header.with_navigation_item(
active: current_page?(support_interface_validation_errors_path),
href: support_interface_validation_errors_path,
text: "Validations",
)
- header.navigation_item(
+ header.with_navigation_item(
active: request.path.start_with?("/support/zendesk"),
href: support_interface_zendesk_path,
text: "Zendesk",
)
if current_staff
- header.navigation_item(href: staff_sign_out_path, text: "Sign out")
+ header.with_navigation_item(href: staff_sign_out_path, text: "Sign out")
else
- header.navigation_item(href: new_staff_session_path, text: "Sign in")
+ header.with_navigation_item(href: new_staff_session_path, text: "Sign in")
end
end
end
diff --git a/app/views/performance/index.html.erb b/app/views/performance/index.html.erb
index 62cd1794d..6e9f4a750 100644
--- a/app/views/performance/index.html.erb
+++ b/app/views/performance/index.html.erb
@@ -63,31 +63,36 @@
No users.
<% else %> <%= govuk_table do |table| - table.head do |head| - head.row do |row| - row.cell(header: true, width: 'one-quarter') do + table.with_head do |head| + head.with_row do |row| + row.with_cell(header: true, width: 'one-quarter') do tag.span("Name") end - row.cell(header: true, width: 'one-quarter') do + row.with_cell(header: true, width: 'one-quarter') do tag.span("Email") end - row.cell(header: true, width: 'one-quarter') do + row.with_cell(header: true, width: 'one-quarter') do tag.span("DQT record") end - row.cell(header: true, width: 'one-quarter') do + row.with_cell(header: true, width: 'one-quarter') do tag.span("TRN") end end end - table.body do |body| + table.with_body do |body| @users.each do |user| - body.row do |row| - row.cell do + body.with_row do |row| + row.with_cell do user_info_link(user) end - row.cell do + row.with_cell do user.email end - row.cell do + row.with_cell do user_dqt_record_status(user) end - row.cell do + row.with_cell do tag.span(user.trn) end end diff --git a/app/views/support_interface/validation_errors/index.html.erb b/app/views/support_interface/validation_errors/index.html.erb index db8543959..eebe9e38a 100644 --- a/app/views/support_interface/validation_errors/index.html.erb +++ b/app/views/support_interface/validation_errors/index.html.erb @@ -11,18 +11,18 @@No tickets need to be deleted.
<% else %> <%= govuk_table do |table| - table.head do |head| - head.row do |row| - row.cell(header: true, width: 'one-quarter') do + table.with_head do |head| + head.with_row do |row| + row.with_cell(header: true, width: 'one-quarter') do tag.span("Ticket link") + tag.span("Group name", class: 'govuk-caption-m') end - row.cell(header: true, width: 'one-third') do + row.with_cell(header: true, width: 'one-third') do tag.span("Closed at") + tag.span("Received at", class: 'govuk-caption-m') end - row.cell(header: true) do + row.with_cell(header: true) do tag.span("Tag: Enquiry type") + tag.span("Tag: No action required", class: 'govuk-caption-m') end end end - table.body do |body| + table.with_body do |body| @zendesk_tickets.each do |ticket| - body.row do |row| - row.cell do + body.with_row do |row| + row.with_cell do tag.a("Ticket #{ticket.ticket_id}", class: 'govuk-link', href: "#{ENV["ZENDESK_URL"]}/agent/tickets/#{ticket.ticket_id}") + tag.span(ticket.group_name, class: 'govuk-caption-m') end - row.cell do + row.with_cell do tag.span(ticket.closed_at, class: 'app-!-font-tabular') + tag.span(ticket.received_at, class: 'app-!-font-tabular govuk-caption-m') end - row.cell do + row.with_cell do tag.code(ticket.enquiry_type, class: 'app-!-word-break-all') + tag.span(ticket.no_action_required, class: 'govuk-caption-m') end @@ -101,37 +101,37 @@ <%= govuk_pagination(pagy: @pagy) %> <%= govuk_table do |table| - table.head do |head| - head.row do |row| - row.cell(header: true, width: 'one-quarter') do + table.with_head do |head| + head.with_row do |row| + row.with_cell(header: true, width: 'one-quarter') do tag.span("Ticket link") + tag.span("Group name", class: 'govuk-caption-m') end - row.cell(header: true, width: 'one-third') do + row.with_cell(header: true, width: 'one-third') do tag.span("Closed at") + tag.span("Received at", class: 'govuk-caption-m') end - row.cell(header: true) do + row.with_cell(header: true) do tag.span("Tag: Enquiry type") + tag.span("Tag: No action required", class: 'govuk-caption-m') end end end - table.body do |body| + table.with_body do |body| @zendesk_delete_requests.each do |ticket| - body.row do |row| - row.cell do + body.with_row do |row| + row.with_cell do tag.a("Ticket #{ticket.ticket_id}", class: 'govuk-link', href: "#{ENV["ZENDESK_URL"]}/agent/tickets/#{ticket.ticket_id}") + tag.span(ticket.group_name, class: 'govuk-caption-m') end - row.cell do + row.with_cell do tag.span(ticket.closed_at, class: 'app-!-font-tabular') + tag.span(ticket.received_at, class: 'app-!-font-tabular govuk-caption-m') end - row.cell do + row.with_cell do tag.code(ticket.enquiry_type, class: 'app-!-word-break-all') + tag.span(ticket.no_action_required, class: 'govuk-caption-m') end diff --git a/spec/components/trn_requests_performance_table_component_spec.rb b/spec/components/trn_requests_performance_table_component_spec.rb index 9ca113e21..9520976e4 100644 --- a/spec/components/trn_requests_performance_table_component_spec.rb +++ b/spec/components/trn_requests_performance_table_component_spec.rb @@ -27,16 +27,17 @@ it "renders a row per period" do expect(rendered_result_text).to include( - "2 June\n 1 (33%) \n 1 (33%) \n 1 (33%) \n 3 requests", + "2 June1 (33%) 1 (33%) 1 (33%) 3 requests" ) expect(rendered_result_text).to include( - "1 June\n 1 (33%) \n 1 (33%) \n 1 (33%) \n 3 requests", + "1 June1 (33%) 1 (33%) 1 (33%) 3 requests" ) + end it "renders the totals row" do expect(rendered_result_text).to include( - "Total (last 7 days)\n 2 (33%) \n 2 (33%) \n 2 (33%) \n 6 requests", + "Total (last 7 days)2 (33%) 2 (33%) 2 (33%) 6 requests" ) end