From a9360b2f74e12bfa7037fd8c6a0801af3220ebb4 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 29 Jul 2024 12:30:57 +0100 Subject: [PATCH 1/5] Improve suitability summary interface This has been requested by our designer. --- .../suitability_records/edit.html.erb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/assessor_interface/suitability_records/edit.html.erb b/app/views/assessor_interface/suitability_records/edit.html.erb index d4b2ce44d..52a91bcc6 100644 --- a/app/views/assessor_interface/suitability_records/edit.html.erb +++ b/app/views/assessor_interface/suitability_records/edit.html.erb @@ -16,17 +16,17 @@ row.with_value { @suitability_record.name } end - @suitability_record.aliases.each do |name_alias| + if (aliases = @suitability_record.aliases).present? summary_list.with_row do |row| - row.with_key { "Alias" } - row.with_value { name_alias } + row.with_key { "Aliases" } + row.with_value { aliases.join("
").html_safe } end end - @suitability_record.emails.map(&:value).each do |email| + if (emails = @suitability_record.emails.map(&:value)).present? summary_list.with_row do |row| - row.with_key { "Email address" } - row.with_value { email } + row.with_key { "Email addresses" } + row.with_value { emails.join("
").html_safe } end end @@ -40,10 +40,10 @@ row.with_value { @suitability_record.date_of_birth.to_fs } end - @suitability_record.application_forms.pluck(:reference).sort.each do |reference| + if (references = @suitability_record.application_forms.pluck(:reference).map(&:to_s).sort).present? summary_list.with_row do |row| - row.with_key { "Application reference" } - row.with_value { reference.to_s } + row.with_key { "Application references" } + row.with_value { references.join("
").html_safe } end end From 3c833d444fabdfc952852d9b586a460e07343d98 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 29 Jul 2024 12:34:16 +0100 Subject: [PATCH 2/5] Fix archive back link This should go back to the edit page for the suitability record. --- .../assessor_interface/suitability_records/archive.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/assessor_interface/suitability_records/archive.html.erb b/app/views/assessor_interface/suitability_records/archive.html.erb index 1c87a41b5..8abaac2a3 100644 --- a/app/views/assessor_interface/suitability_records/archive.html.erb +++ b/app/views/assessor_interface/suitability_records/archive.html.erb @@ -1,7 +1,7 @@ <% title = "Archive suitability record for #{@suitability_record.name}" %> <% content_for :page_title, title %> -<% content_for :back_link_url, assessor_interface_suitability_records_path %> +<% content_for :back_link_url, edit_assessor_interface_suitability_record_path %> <%= form_with model: @form, url: [:assessor_interface, @suitability_record], method: :delete do |f| %> <%= f.govuk_error_summary %> @@ -11,6 +11,6 @@ <%= f.govuk_text_area :note %> <%= f.govuk_submit "Archive record" do %> - <%= govuk_link_to "Cancel", %i[assessor_interface suitability_records] %> + <%= govuk_link_to "Cancel", edit_assessor_interface_suitability_record_path %> <% end %> <% end %> From 68d1f0ad4787b33f9f9caaec8a9f056b8c453cb0 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 29 Jul 2024 12:52:10 +0100 Subject: [PATCH 3/5] Show suitability dates in local time This ensure they're in the right timezone. --- .../assessor_interface/suitability_records/edit.html.erb | 4 ++-- .../assessor_interface/suitability_records/index.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/assessor_interface/suitability_records/edit.html.erb b/app/views/assessor_interface/suitability_records/edit.html.erb index 52a91bcc6..be6ae2a31 100644 --- a/app/views/assessor_interface/suitability_records/edit.html.erb +++ b/app/views/assessor_interface/suitability_records/edit.html.erb @@ -59,13 +59,13 @@ summary_list.with_row do |row| row.with_key { "Date added" } - row.with_value { @suitability_record.created_at.to_fs } + row.with_value { @suitability_record.created_at.localtime.to_fs } end if @suitability_record.updated_at != @suitability_record.created_at summary_list.with_row do |row| row.with_key { "Date last updated" } - row.with_value { @suitability_record.updated_at.to_fs } + row.with_value { @suitability_record.updated_at.localtime.to_fs } end end diff --git a/app/views/assessor_interface/suitability_records/index.html.erb b/app/views/assessor_interface/suitability_records/index.html.erb index 0fdd36d92..fcb7225a3 100644 --- a/app/views/assessor_interface/suitability_records/index.html.erb +++ b/app/views/assessor_interface/suitability_records/index.html.erb @@ -25,13 +25,13 @@ <%= govuk_summary_list(actions: false) do |summary_list| summary_list.with_row do |row| row.with_key { "Date added" } - row.with_value { suitability_record.created_at.to_fs } + row.with_value { suitability_record.created_at.localtime.to_fs } end if suitability_record.updated_at != suitability_record.created_at summary_list.with_row do |row| row.with_key { "Date last updated" } - row.with_value { suitability_record.updated_at.to_fs } + row.with_value { suitability_record.updated_at.localtime.to_fs } end end From 366054801c6aa394fdb3066e01abcaf10d2a1aaf Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 29 Jul 2024 12:53:23 +0100 Subject: [PATCH 4/5] Fix incorrect error message content This should use the word "the". --- config/locales/assessor_interface.en.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/assessor_interface.en.yml b/config/locales/assessor_interface.en.yml index c97a84c9f..eccf1cd3f 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -414,11 +414,11 @@ en: assessor_interface/suitability_record_form: attributes: name: - blank: Enter a name + blank: Enter the name location: - blank: Enter a country trained in + blank: Enter the country trained in date_of_birth: - blank: Enter a date of birth + blank: Enter the date of birth note: blank: Briefly explain why you have created this suitability record assessor_interface/upload_unsigned_consent_document_form: From 7dfecaecd6f839f0626af0cf14ba2f9c962f7955 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 29 Jul 2024 13:09:30 +0100 Subject: [PATCH 5/5] Add cancel link on archived page This is to match the designs. --- .../assessor_interface/suitability_records/edit.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/assessor_interface/suitability_records/edit.html.erb b/app/views/assessor_interface/suitability_records/edit.html.erb index be6ae2a31..c85ec3204 100644 --- a/app/views/assessor_interface/suitability_records/edit.html.erb +++ b/app/views/assessor_interface/suitability_records/edit.html.erb @@ -83,7 +83,9 @@ end %> <% if @suitability_record.archived? %> - <%= f.govuk_submit "Set to active", secondary: true %> + <%= f.govuk_submit "Set to active" do %> + <%= govuk_link_to "Cancel", %i[assessor_interface suitability_records] %> + <% end %> <% else %>

Update record