From 32e59a1c2bda24954078b6ffbf7267b0555441e7 Mon Sep 17 00:00:00 2001 From: agz deberny gomes Date: Thu, 24 Apr 2025 11:29:52 +0100 Subject: [PATCH 1/4] Update content for file upload on answer type page --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index c695bc5ab..f273fd700 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -705,7 +705,7 @@ en: address: '' date: '' email: '' - file: People will be able to upload an image or a document + file: People will only be able to upload one file name: '' national_insurance_number: '' number: People will only be able to enter whole or decimal numbers From 5d2d9c2b27a844acf17b38fd1dde62ff3cb72bef Mon Sep 17 00:00:00 2001 From: agz deberny gomes Date: Thu, 24 Apr 2025 15:27:05 +0100 Subject: [PATCH 2/4] Update content for file upload edit question page --- app/views/pages/_form.html.erb | 3 +++ config/locales/en.yml | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/views/pages/_form.html.erb b/app/views/pages/_form.html.erb index 251443640..230c51a75 100644 --- a/app/views/pages/_form.html.erb +++ b/app/views/pages/_form.html.erb @@ -3,6 +3,9 @@ <% if question_input.answer_type == "file" %>

<%=t('helpers.label.pages_question_input.file_body_html')%>

+ <%= govuk_details(summary_text: t("helpers.label.pages_question_input.summary")) do %> + <% t("helpers.label.pages_question_input.summary_body_html") %> + <% end %> <% end %> <%= f.govuk_text_field :question_text, diff --git a/config/locales/en.yml b/config/locales/en.yml index f273fd700..c37803ea6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -618,7 +618,7 @@ en: date_of_birth: You can add a short hint to help people answer the question. For a date of birth question you could use ‘For example, 27 3 1998’. default: You can add a short hint to help people answer the question. For example, to explain the format the answer should be in, or where to find the information you’ve asked for. email: You could add a short hint to tell people how you’ll use their email address. For example, ‘We’ll only use your email address to contact you about your application.’ - file: You can add a short hint to help people upload the file you need. For example, you might need the file to contain specific information. + file: You can add a short hint to help people upload the file you need. For example, you might need the file to contain specific information. People will be shown the types of file they can upload. long_text: You can add a short hint to help people answer the question. For example, you could give a bit more detail about the information you need. name: You can add a short hint to help people answer the question. For example, you might need to ask people to enter their name as it’s written on an official document such as a passport or driving licence. national_insurance_number: You can add a short hint to help people answer the question. For example, ‘It’s on your National Insurance card, benefit letter, payslip or P60. For example, QQ 12 34 56 C.’ @@ -770,8 +770,20 @@ en: default_goto_page_id: Select a question or page pages_question_input: file_body_html: | -

People will be able to upload one image or document up to 7MB in size.

-

You can have up to 4 file upload questions in a form.

+

People can only upload one file for each file upload question.

+

A form can have up to 4 file upload questions.

+ summary: What files can people upload? + summary_body_html: | +

People can upload the following file types:

+ +

Each file must be smaller than 7MB.

hint_text: Hint text (optional) is_optional_options: 'false': Mandatory From 760e6ef1a4ef4611306326d8ce11ca088cca8e0c Mon Sep 17 00:00:00 2001 From: agz deberny gomes Date: Thu, 24 Apr 2025 16:41:22 +0100 Subject: [PATCH 3/4] Normalise the en file --- config/locales/en.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index c37803ea6..72092c576 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -772,6 +772,16 @@ en: file_body_html: |

People can only upload one file for each file upload question.

A form can have up to 4 file upload questions.

+ hint_text: Hint text (optional) + is_optional_options: + 'false': Mandatory + 'true': Optional + is_repeatable_options: + 'false': No - this question can only be answered once + 'true': 'Yes' + question_text: + default: Question text + file: Ask for a file summary: What files can people upload? summary_body_html: |

People can upload the following file types:

@@ -784,16 +794,6 @@ en:
  • text (.json, .odt, .rtf, .txt)
  • Each file must be smaller than 7MB.

    - hint_text: Hint text (optional) - is_optional_options: - 'false': Mandatory - 'true': Optional - is_repeatable_options: - 'false': No - this question can only be answered once - 'true': 'Yes' - question_text: - default: Question text - file: Ask for a file pages_secondary_skip_input: default_goto_page_id: Select a question or page default_routing_page_id: Select a question From 00116930538b0d99ef47b692f6b366704d3d2464 Mon Sep 17 00:00:00 2001 From: agz deberny gomes Date: Thu, 24 Apr 2025 17:05:42 +0100 Subject: [PATCH 4/4] Update rspec tests --- spec/views/pages/_forms.html.erb_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/views/pages/_forms.html.erb_spec.rb b/spec/views/pages/_forms.html.erb_spec.rb index 4ff8594c6..837cc75a7 100644 --- a/spec/views/pages/_forms.html.erb_spec.rb +++ b/spec/views/pages/_forms.html.erb_spec.rb @@ -136,6 +136,7 @@ it "does not display the file body text" do expect(rendered).not_to have_text(I18n.t("helpers.label.pages_question_input.file_body_html")) + expect(rendered).not_to have_text(I18n.t("helpers.label.pages_question_input.summary")) end context "when the answer type is file" do @@ -152,6 +153,8 @@ it "displays the file body text" do expect(rendered).to include(I18n.t("helpers.label.pages_question_input.file_body_html")) + expect(rendered).to have_text(I18n.t("helpers.label.pages_question_input.summary")) + expect(rendered).to include(I18n.t("helpers.label.pages_question_input.summary_body_html")) end it "has a field with the file question text" do