Skip to content

Update content for create file upload question #1916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/views/pages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

<% if question_input.answer_type == "file" %>
<p class="govuk-body"><%=t('helpers.label.pages_question_input.file_body_html')%></p>
<%= 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,
Expand Down
20 changes: 16 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.’
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -770,8 +770,8 @@ en:
default_goto_page_id: Select a question or page
pages_question_input:
file_body_html: |
<p>People will be able to upload one image or document up to 7MB in size.</p>
<p>You can have up to 4 file upload questions in a form.</p>
<p>People can only upload one file for each file upload question.</p>
<p>A form can have up to 4 file upload questions.</p>
hint_text: Hint text (optional)
is_optional_options:
'false': Mandatory
Expand All @@ -782,6 +782,18 @@ en:
question_text:
default: Question text
file: Ask for a file
summary: What files can people upload?
summary_body_html: |
<p>People can upload the following file types:</p>
<ul class="govuk-list govuk-list--bullet">
<li>CSV (.csv)</li>
<li>image (.jpeg, .jpg, .png)</li>
<li>Microsoft Excel Spreadsheet (.xlsx)</li>
<li>Microsoft Word Document (.doc, .docx)</li>
<li>PDF (.pdf)</li>
<li>text (.json, .odt, .rtf, .txt)</li>
</ul>
<p>Each file must be smaller than 7MB.</p>
pages_secondary_skip_input:
default_goto_page_id: Select a question or page
default_routing_page_id: Select a question
Expand Down
3 changes: 3 additions & 0 deletions spec/views/pages/_forms.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down