From 9bb0e70c28548a9882665f3e02b657517dc73a1f Mon Sep 17 00:00:00 2001 From: DaniBitZesty <84323332+DaniBitZesty@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:17:19 +0100 Subject: [PATCH 1/2] - Show status of attachment when first uploaded. - Correct file name styling to govuk-body. - Update first name label on support letters form. --- .../frontend/custom_questions/support_letters.js.coffee | 3 ++- app/assets/stylesheets/frontend/views/award_form.scss | 6 ------ app/views/form/support_letters/_form.html.slim | 2 +- app/views/qae_form/_supporter_fields.html.slim | 2 +- app/views/support_letters/_attachment.html.slim | 5 ++--- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee b/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee index ee26595e5..997ec6639 100644 --- a/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee +++ b/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee @@ -32,7 +32,8 @@ window.SupportLetters = textContainer = parent.find('.support-letter-attachment-container') textContainer.removeClass('govuk-!-display-none') - textContainer.find('.flex').html('
' + filename + '
') + scanningText = '(File uploaded and is being scanned for viruses. Preview available once the scan is complete.)
' + textContainer.prepend(' ') hiddenInput = $("") parent.append(hiddenInput) parent.find('.js-support-letter-attachment').addClass('govuk-!-display-none') diff --git a/app/assets/stylesheets/frontend/views/award_form.scss b/app/assets/stylesheets/frontend/views/award_form.scss index 8f7269b8d..6de7f48b7 100644 --- a/app/assets/stylesheets/frontend/views/award_form.scss +++ b/app/assets/stylesheets/frontend/views/award_form.scss @@ -164,12 +164,6 @@ label > .visible-read-only, align-items: start; background: $govuk-light-grey; - .flex { - display: flex; - justify-content: space-between; - align-items: start; - } - .js-remove-support-letter-attachment{ color: $govuk-red; word-break: keep-all; diff --git a/app/views/form/support_letters/_form.html.slim b/app/views/form/support_letters/_form.html.slim index 96721fe79..e5f3cdac2 100644 --- a/app/views/form/support_letters/_form.html.slim +++ b/app/views/form/support_letters/_form.html.slim @@ -13,7 +13,7 @@ = render "qae_form/question_ref", question: question, ref: "C #{idx}.1" span[class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block"] = "Name of the person who wrote the #{first_or_second} letter of support" - = ff.input :first_name, label: "First Name:", input_html: { class: "form-control medium" } + = ff.input :first_name, label: "First name:", input_html: { class: "form-control medium" } = ff.input :last_name, label: "Surname:", input_html: { class: "form-control medium" } legend.govuk-label aria-label="C #{idx}.2: Relationship to Group" diff --git a/app/views/qae_form/_supporter_fields.html.slim b/app/views/qae_form/_supporter_fields.html.slim index 5717db4ac..e345cd1e9 100644 --- a/app/views/qae_form/_supporter_fields.html.slim +++ b/app/views/qae_form/_supporter_fields.html.slim @@ -20,7 +20,7 @@ li.borderless[class=class_names("js-add-example", "js-support-letter-received" = ' Name of the person who wrote the #{first_or_second} letter of support .govuk-form-group.question-block.question-required label.govuk-label for="form[#{question.key}][#{index}][first_name]" - ' First Name: + ' First name: span.govuk-error-message input.js-support-letter-field.js-support-letter-first-name.js-trigger-autosave.govuk-input autocomplete="off" class="js-trigger-autosave medium" name="form[#{question.key}][#{index}][first_name]" id="form[#{question.key}][#{index}][first_name]" type="text" value=supporter["first_name"] *possible_read_only_ops(question.step.opts[:id]) .govuk-form-group.question-block.question-required diff --git a/app/views/support_letters/_attachment.html.slim b/app/views/support_letters/_attachment.html.slim index 49f374dfc..2d5dd4906 100644 --- a/app/views/support_letters/_attachment.html.slim +++ b/app/views/support_letters/_attachment.html.slim @@ -1,9 +1,8 @@ - file = support_letter_attachments[attachment_id.to_i] .support-letter-attachment-container class="#{'govuk-!-display-none' unless attachment_id.present?}" - .flex - .support-letter-attachment-filename class="govuk-!-font-size-19" - = render "shared/attachment_with_virus_check_status", item: file, mount_name: :attachment + .support-letter-attachment-filename class="govuk-body govuk-!-font-size-19" + = render "shared/attachment_with_virus_check_status", item: file, mount_name: :attachment button.govuk-link.js-remove-support-letter-attachment class="govuk-!-font-size-19" data-module="govuk-button" type="button" | Remove input.js-support-letter-attachment-id type="hidden" name="form[#{question.key}][#{index}][letter_of_support]" value=attachment_id *possible_read_only_ops From f06a4a6b8fb8f292563ea2bf03f80968cef625d0 Mon Sep 17 00:00:00 2001 From: DaniBitZesty <84323332+DaniBitZesty@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:17:24 +0100 Subject: [PATCH 2/2] Remove random square bracket in icon link - causing deployment errors --- app/views/layouts/govuk_template.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/govuk_template.html.erb b/app/views/layouts/govuk_template.html.erb index e536f6ee1..aff39db55 100644 --- a/app/views/layouts/govuk_template.html.erb +++ b/app/views/layouts/govuk_template.html.erb @@ -31,7 +31,7 @@ <%= stylesheet_pack_tag 'application' %> - +