From 209716bc8340543e3d8c561ff956584d75a50069 Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Fri, 15 Nov 2024 09:35:56 +0000 Subject: [PATCH 1/4] Fix: moves reports heading above award year select Signed-off-by: Louis Kirkham --- app/views/assessor/reports/_case_status_report.html.slim | 2 -- app/views/assessor/reports/index.html.slim | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/assessor/reports/_case_status_report.html.slim b/app/views/assessor/reports/_case_status_report.html.slim index f1e305473f..246894a1ca 100644 --- a/app/views/assessor/reports/_case_status_report.html.slim +++ b/app/views/assessor/reports/_case_status_report.html.slim @@ -1,6 +1,4 @@ .well - h1 - ' Reports ul.list-unstyled.list-actions li = link_to assessor_report_path("cases-status", format: :csv, year: @award_year.year), class: "action-title" do diff --git a/app/views/assessor/reports/index.html.slim b/app/views/assessor/reports/index.html.slim index 4d1e3edf12..ee06f99d32 100644 --- a/app/views/assessor/reports/index.html.slim +++ b/app/views/assessor/reports/index.html.slim @@ -1,5 +1,6 @@ - title "Assessor: Reports" - +h1.admin-page-heading + ' Reports .row = render "layouts/admin_award_year" .clear @@ -11,4 +12,3 @@ br = render "assessor/reports/primary_vs_secondary_appraisals" if @award_year.year > 2019 = render "assessor/reports/assessors_progress" = render "assessor/reports/case_summaries" - From 15be1b1724f05c3fc4a85598b45464a2fe8ecbf4 Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Fri, 15 Nov 2024 10:21:23 +0000 Subject: [PATCH 2/4] Fix: fix accessibility issues on checkboxes Signed-off-by: Louis Kirkham --- app/assets/stylesheets/admin/forms.scss | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/admin/forms.scss b/app/assets/stylesheets/admin/forms.scss index 37bb747f65..7df88ffa3b 100644 --- a/app/assets/stylesheets/admin/forms.scss +++ b/app/assets/stylesheets/admin/forms.scss @@ -65,9 +65,13 @@ input.form-control, select.form-control, } .section-contact-preferences .selectable { - cursor: auto; - - input[type="checkbox"] { - margin-top: 10px; + label, input { + cursor: pointer; + } + input { + position: inherit; + } + label { + display: inline; } } From 204901590276380aaade3c01f21aa600d52f8fab Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Fri, 15 Nov 2024 11:02:24 +0000 Subject: [PATCH 3/4] Fix: Adds missing labels for admin/form_answer#show Signed-off-by: Louis Kirkham --- app/views/admin/audit_certificate/_form.html.slim | 3 ++- app/views/admin/figures_and_vat_returns/_form.html.slim | 1 + .../appraisal_form_components/_rag_section.html.slim | 5 +++-- .../appraisal_form_components/_verdict_section.html.slim | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/admin/audit_certificate/_form.html.slim b/app/views/admin/audit_certificate/_form.html.slim index dbb14c45c7..7a27b3259b 100644 --- a/app/views/admin/audit_certificate/_form.html.slim +++ b/app/views/admin/audit_certificate/_form.html.slim @@ -15,10 +15,11 @@ span[aria-hidden="true"] × .attachment-link.if-js-hide + = form.label :attachment, "Attach document", class: "visuallyhidden", for: "audit_certificate_attachment" = form.file_field :attachment .form-group - label.form-label Document title + = form.label :attachment, "Document title", class: "form-label", for: "audit_certificate_attachment_input" = form.text_field :attachment, class: "form-control attachment-title", id: "audit_certificate_attachment_input" .form-actions.text-right diff --git a/app/views/admin/figures_and_vat_returns/_form.html.slim b/app/views/admin/figures_and_vat_returns/_form.html.slim index 8a5f591c9b..afcf46c0f1 100644 --- a/app/views/admin/figures_and_vat_returns/_form.html.slim +++ b/app/views/admin/figures_and_vat_returns/_form.html.slim @@ -15,6 +15,7 @@ span[aria-hidden="true"] × .attachment-link.if-js-hide + = form.label :attachment, "Attach document", class: "visuallyhidden" = form.file_field :attachment .form-actions.text-right diff --git a/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim b/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim index 5eb56ab977..71a7f65265 100644 --- a/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim +++ b/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim @@ -7,9 +7,10 @@ .form-container = f.input section.rate, as: :select, - label: false, + label: section.label, collection: form.options, - input_html: { class: "if-js-hide", "data-updated-section" => section.rate, id: "#{f.object.position}_#{section.desc}_select" } + input_html: { class: "if-js-hide", "data-updated-section" => section.rate, id: "#{f.object.position}_#{section.desc}_select" }, + label_html: { class: "visuallyhidden" } label.form-label.form-label-rag for="#{f.object.position}_#{section.desc}_comment" span.rag_section_label diff --git a/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim b/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim index 313f8d64aa..3b72b79e6d 100644 --- a/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim +++ b/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim @@ -6,9 +6,10 @@ .form-container = f.input section.rate, as: :select, - label: false, + label: section.label, collection: form.options, - input_html: { class: "if-js-hide", "data-updated-section" => section.desc, id: "#{f.object.position}_#{section.desc}_select"} + input_html: { class: "if-js-hide", "data-updated-section" => section.desc, id: "#{f.object.position}_#{section.desc}_select"}, + label_html: { class: "visuallyhidden" } label.form-label.form-label-rag for="#{f.object.position}_verdict" = section.label From d748a5de913aff2297491b20d52cb68c4a248a00 Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Mon, 18 Nov 2024 10:44:23 +0000 Subject: [PATCH 4/4] Fix: adds missing or duplicated labels on palace form Signed-off-by: Louis Kirkham --- .../_section_palace_attendees.html.slim | 10 ++-- .../_palace_attendee_form.html.slim | 51 +++++++------------ .../palace_attendees_fulfilling_spec.rb | 4 +- 3 files changed, 24 insertions(+), 41 deletions(-) diff --git a/app/views/admin/form_answers/_section_palace_attendees.html.slim b/app/views/admin/form_answers/_section_palace_attendees.html.slim index 3382705e97..3c652ff124 100644 --- a/app/views/admin/form_answers/_section_palace_attendees.html.slim +++ b/app/views/admin/form_answers/_section_palace_attendees.html.slim @@ -6,13 +6,13 @@ a data-toggle="collapse" data-parent="#panel-winners" href="#section-palace-attendees" aria-expanded="true" aria-controls="section-palace-attendees" ' Palace Attendees #section-palace-attendees.section-palace-attendees.panel-collapse.collapse aria-labelledby="palace-attendees-heading" - .panel-body.if-no-js-hide - - palace_invite.palace_attendees.build if palace_invite.palace_attendees.blank? - - palace_invite.palace_attendees.each_with_index do |pa, index| - = render(partial: "admin/form_answers/winners_components/palace_attendee", locals: { index: index, pa: pa, palace_invite: palace_invite }) - .panel-body.if-js-hide + .panel-body - palace_invite.prebuild_if_necessary.palace_attendees.each_with_index do |pa, index| = render(partial: "admin/form_answers/winners_components/palace_attendee", locals: { index: index, pa: pa, palace_invite: palace_invite }) + / While the palace attendee limit is 1, there is no need to have a JS and non JS form. + / .panel-body.if-js-hide + / - palace_invite.palace_attendees.each_with_index do |pa, index| + / = render(partial: "admin/form_answers/winners_components/palace_attendee", locals: { index: index + 1, pa: pa, palace_invite: palace_invite }) #palace-invite-submit-form[data-controller="inline-flash"] = render "admin/form_answers/winners_components/palace_invite_submit_form", palace_invite: palace_invite diff --git a/app/views/admin/form_answers/winners_components/_palace_attendee_form.html.slim b/app/views/admin/form_answers/winners_components/_palace_attendee_form.html.slim index 20b15da647..2a58ab7120 100644 --- a/app/views/admin/form_answers/winners_components/_palace_attendee_form.html.slim +++ b/app/views/admin/form_answers/winners_components/_palace_attendee_form.html.slim @@ -11,78 +11,61 @@ ul.list-add.list-attendees class=('if-js-hide' if palace_attendee.new_record? && = f.input :palace_invite_id, as: :hidden .row .col-md-2 - label Title - = f.input :title, input_html: { class: "form-control" }, label: false, as: :string + = f.input :title, as: :string, label: "Title", input_html: { class: "form-control", id: "palace_attendee_title_#{index}" } .row .col-md-5 - label First name - = f.input :first_name, input_html: { class: "form-control" }, label: false, as: :string + = f.input :first_name, as: :string, label: "First name", input_html: { class: "form-control", id: "palace_attendee_first_name_#{index}" } .row .col-md-5 - label Surname - = f.input :last_name, input_html: { class: "form-control" }, label: false, as: :string + = f.input :last_name, as: :string, label: "Last name", input_html: { class: "form-control", id: "palace_attendee_last_name_#{index}" } .row .col-md-8 - label Job title/position - = f.input :job_name, input_html: { class: "form-control" }, label: false, as: :string + = f.input :job_name, as: :string, label: "Job title/position", input_html: { class: "form-control", id: "palace_attendee_job_name_#{index}" } .row .col-md-8 - label Decorations/post-nominals - = f.input :post_nominals, input_html: { class: "form-control" }, label: false, as: :string + = f.input :post_nominals, as: :string, label: "Decorations/post-nominals", input_html: { class: "form-control", id: "palace_attendee_post_nominals_#{index}" } .row .col-md-8 - label Do you or your organisation have any associations and connections with The Royal Family? + = f.label :has_royal_family_connections, "Do you or your organisation have any associations and connections with The Royal Family?" span.govuk-hint | Answer yes, if: ol.govuk-list.govuk-list--number li.govuk-hint 1. A member of The Royal Family has visited your organisation or is a patron of your charity, or your company is a Duchy company. li.govuk-hint 2. You have met a member of a Royal Family before, have received an Honour or Royal award, are involved with The Prince's Trust or any other organisation supported by a member of The Royal Family, or have other associations with The Royal Family. - = f.input :has_royal_family_connections, as: :radio_buttons, label: false, input_html: { class: "js-has-royal-connections" }, wrapper_html: { class: "has-royal-family-connections-wrapper" } + = f.input :has_royal_family_connections, as: :radio_buttons, label: false, input_html: { class: "js-has-royal-connections"}, wrapper_html: { class: "has-royal-family-connections-wrapper" } .row.royal-connection-wrapper .col-md-8 - label Please provide details of your or your organisation's associations with the Royal Family. - = f.input :royal_family_connection_details, as: :text, input_html: { rows: 5, data: { "word-max" => 100 }, class: "js-char-count js-royal-connection-details form-control" }, label: false + = f.input :royal_family_connection_details, as: :text, label: "Please provide details of your or your organisation's associations with the Royal Family.", input_html: { rows: 5, data: { "word-max" => 100 }, class: "js-char-count js-royal-connection-details form-control", id: "palace_attendee_royal_family_connection_details_#{index}" } .row .col-md-8 - label Address line 1 - = f.input :address_1, input_html: { class: "form-control" }, label: false, as: :string + = f.input :address_1, as: :string, label: "Address line 1", input_html: { class: "form-control", id: "palace_attendee_address_1_#{index}" } p.help-block The address should match the identification documents the attendee will bring on the evening. More detailed guidance will be provided with the formal invitation. .row .col-md-8 - label Address line 2 - = f.input :address_2, input_html: { class: "form-control" }, label: false, as: :string - .row + = f.input :address_2, as: :string, label: "Address line 2", input_html: { class: "form-control", id: "palace_attendee_address_2__#{index}" } .col-md-8 - label City or town - = f.input :address_3, input_html: { class: "form-control" }, label: false, as: :string + = f.input :address_3, as: :string, label: "City or town", input_html: { class: "form-control", id: "palace_attendee_address_3__#{index}" } .row .col-md-8 - label County - = f.input :address_4, input_html: { class: "form-control" }, label: false, as: :string + = f.input :address_4, as: :string, label: "County", input_html: { class: "form-control", id: "palace_attendee_address_4_#{index}" } .row .col-md-2 - label Postcode - = f.input :postcode, input_html: { class: "form-control" }, label: false, as: :string - .row + = f.input :postcode, as: :string, label: "Postcode", input_html: { class: "form-control", id: "palace_attendee_postcode_#{index}" } .col-md-3 - label Telephone number - = f.input :phone_number, input_html: { class: "form-control" }, label: false, as: :string + = f.input :phone_number, as: :string, label: "Telephone number", input_html: { class: "form-control", id: "palace_attendee_phone_number_#{index}" } p.help-block If known .row .col-md-12 - label Dietary needs - = f.input :dietary_requirements, input_html: { class: "form-control", rows: 2 }, label: false, as: :text + = f.input :dietary_requirements, as: :text, label: "Dietary needs", input_html: { class: "form-control", id: "palace_attendee_dietary_requirements_#{index}", rows: 2 } .row .col-md-8 - label Does the attendee require disabled access? - = f.input :disabled_access, as: :radio_buttons, label: false, wrapper_html: { class: "disabled-access-wrapper" } + = f.input :disabled_access, as: :radio_buttons, label: "Does the attendee require disabled access?", wrapper_html: { class: "disabled-access-wrapper", id: "palace_attendee_disabled_access_#{index}" } - unless @form_answer.promotion? .row .col-md-12 - label Accessibility details (for example, wheelchair user or person hard of hearing) - = f.input :additional_info, as: :text, input_html: { class: "form-control", rows: 2 }, label: false + = f.input :additional_info, as: :text, label: "Accessibility details (for example, wheelchair user or person hard of hearing)", input_html: { class: "form-control", id: "palace_attendee_additional_info_#{index}", rows: 2 } .row .col-md-12 .form-actions.text-right diff --git a/spec/features/admin/form_answers/palace_attendees_fulfilling_spec.rb b/spec/features/admin/form_answers/palace_attendees_fulfilling_spec.rb index a7865f23b4..98b018c867 100644 --- a/spec/features/admin/form_answers/palace_attendees_fulfilling_spec.rb +++ b/spec/features/admin/form_answers/palace_attendees_fulfilling_spec.rb @@ -41,10 +41,10 @@ find(".form-edit-link").click within "#new_palace_attendee" do # waiting for the last input to be rendered - find("input#palace_attendee_phone_number") + find("input#palace_attendee_phone_number_0") find("input#palace_attendee_has_royal_family_connections_true").set(true) find("input#palace_attendee_disabled_access_true").set(true) - fill_in "palace_attendee_royal_family_connection_details", with: "connection details" + fill_in "palace_attendee_royal_family_connection_details_0", with: "connection details" all("input.form-control").each_with_index do |input, index| val = "val-#{index}" field_values << val