"There #{is_or_are}#{pluralize(log_count,'log')} in this bulk upload with #{pluralize(error_count,'error')} that still #{need_or_needs} to be fixed after upload."
"You will upload #{pluralize(bulk_upload.total_logs_count,'log')}. There are errors in #{pluralize(bulk_upload.logs_with_errors_count,'log')}, and #{pluralize(bulk_upload.bulk_upload_errors.count,'error')} in total. #{this_or_these_errors} will need to be fixed on the CORE site."
"You will upload #{pluralize(bulk_upload.total_logs_count,'log')}. There are unexpected answers in #{pluralize(bulk_upload.logs_with_errors_count,'log')}, and #{pluralize(bulk_upload.bulk_upload_errors.count,'unexpected answer')} in total. #{this_or_these_unexpected_answers} will be marked as correct."
end
defbulk_upload_error_summary(bulk_upload)
"You have tried to upload #{bulk_upload.total_logs_count?pluralize(bulk_upload.total_logs_count,'log'):'logs'}. There are errors in #{pluralize(bulk_upload.logs_with_errors_count,'log')}, and #{pluralize(bulk_upload.bulk_upload_errors.count,'error')} in total."
"For this many errors we recommend to fix errors in the CSV and re-upload as you may be able to edit many fields at once in a CSV."
"We recommend fixing these errors in the CSV, as you may be able to edit multiple fields at once. However, you can also upload these logs and fix the errors on the CORE site."
else
else
"For this many errors we recommend to upload logs and fix errors on site as you can easily see the questions and select the appropriate answer."
"We recommend uploading logs and fixing errors on site as you can easily see the questions and select the appropriate answer. However, you can also fix these errors in the CSV."
"For this many errors we recommend to fix errors in the CSV and re-upload as you may be able to edit many fields at once in a CSV."
"We recommend fixing these errors in the CSV, as you may be able to edit multiple fields at once. However, you can also upload these logs and fix the errors on the CORE site."
else
else
"For this many errors we recommend to upload logs and fix errors on site as you can easily see the questions and select the appropriate answer."
"We recommend uploading logs and fixing errors on site as you can easily see the questions and select the appropriate answer. However, you can also fix these errors in the CSV."
<span class="govuk-caption-l">Bulk upload for lettings (<%= @bulk_upload.year_combo %>)</span>
<span class="govuk-caption-l">Bulk upload for lettings (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">How would you like to fix <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %>?</h1>
<h1 class="govuk-heading-l">How would you like to fix the errors?</h1>
<div class="govuk-body-l">
<div class="govuk-body-l">
File: <%= @bulk_upload.filename %>
File: <%= @bulk_upload.filename %>
</div>
</div>
<div class="govuk-body">
<%= bulk_upload_error_summary(@bulk_upload) %>
</div>
<div class="govuk-body">
<div class="govuk-body">
<%= @form.recommendation %>
<%= @form.recommendation %>
</div>
</div>
<%= govuk_details(summary_text: "How to choose between fixing errors on the CORE site or in the CSV") do %>
<%= govuk_details(summary_text: "How to choose between fixing errors on the CORE site or in the CSV") do %>
<p class="govuk-body">When it comes to fixing errors, there are pros and cons to doing it on a CSV versus doing it on a website.</p>
<p class="govuk-body govuk-!-margin-bottom-2">You may find it easier to fix the errors in the CSV file if:</p>
<ul class="govuk-list govuk-list--bullet">
<p class="govuk-body">Fixing errors on a CSV file can be beneficial because it allows you to easily make changes to multiple records at once, and you can use tools like Excel to quickly identify and correct errors. However, if the CSV file is not properly formatted, it can be difficult to identify which records contain errors.</p>
<li>you have a lot of errors</li>
<li>the CSV file is formatted incorrectly and you can see where the errors are</li>
<p class="govuk-body">Fixing errors on a website can be convenient because you can see the data in context and make changes in real-time. However, this approach can be time-consuming if you need to make changes to multiple records, and it may be more difficult to identify errors in a large dataset.</p>
<li>you need to fix multiple errors at once</li>
</ul>
<p class="govuk-body">Ultimately, the best approach will depend on the specific situation and the nature of the errors that need to be fixed.</p>
<p class="govuk-body govuk-!-margin-bottom-2">You may find it easier to fix the errors on the CORE site if:</p>
<ul class="govuk-list govuk-list--bullet">
<li>you need to see the data in context</li>
<li>you have a smaller file, with a few errors</li>
<span class="govuk-caption-l">Bulk upload for lettings (<%= @bulk_upload.year_combo %>)</span>
<span class="govuk-caption-l">Bulk upload for lettings (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">Are you sure you want to upload all logs from this bulk upload?</h1>
<h1 class="govuk-heading-l">You have chosen to upload all logs from this bulk upload.</h1>
<p class="govuk-body">There are <%= pluralize(@bulk_upload.logs.count, "log") %> in this bulk upload, and <%= pluralize(@bulk_upload.bulk_upload_errors.count, "unexpected answer") %> will be marked as correct.</p>
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span>
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">Are you sure you want to upload all logs from this bulk upload?</h1>
<h1 class="govuk-heading-l">You have chosen to upload all logs from this bulk upload.</h1>
<p class="govuk-body">There are <%= pluralize(@bulk_upload.logs.count, "log") %> in this bulk upload with <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> that still need to be fixed after upload.</p>
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span>
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">How would you like to fix <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %>?</h1>
<h1 class="govuk-heading-l">How would you like to fix the errors?</h1>
<div class="govuk-body-l">
<div class="govuk-body-l">
File: <%= @bulk_upload.filename %>
File: <%= @bulk_upload.filename %>
</div>
</div>
<div class="govuk-body">
<%= bulk_upload_error_summary(@bulk_upload) %>
</div>
<div class="govuk-body">
<div class="govuk-body">
<%= @form.recommendation %>
<%= @form.recommendation %>
</div>
</div>
<%= govuk_details(summary_text: "How to choose between fixing errors on the CORE site or in the CSV") do %>
<%= govuk_details(summary_text: "How to choose between fixing errors on the CORE site or in the CSV") do %>
<p class="govuk-body">When it comes to fixing errors, there are pros and cons to doing it on a CSV versus doing it on a website.</p>
<p class="govuk-body govuk-!-margin-bottom-2">You may find it easier to fix the errors in the CSV file if:</p>
<ul class="govuk-list govuk-list--bullet">
<p class="govuk-body">Fixing errors on a CSV file can be beneficial because it allows you to easily make changes to multiple records at once, and you can use tools like Excel to quickly identify and correct errors. However, if the CSV file is not properly formatted, it can be difficult to identify which records contain errors.</p>
<li>you have a lot of errors</li>
<li>the CSV file is formatted incorrectly and you can see where the errors are</li>
<p class="govuk-body">Fixing errors on a website can be convenient because you can see the data in context and make changes in real-time. However, this approach can be time-consuming if you need to make changes to multiple records, and it may be more difficult to identify errors in a large dataset.</p>
<li>you need to fix multiple errors at once</li>
</ul>
<p class="govuk-body">Ultimately, the best approach will depend on the specific situation and the nature of the errors that need to be fixed.</p>
<p class="govuk-body govuk-!-margin-bottom-2">You may find it easier to fix the errors on the CORE site if:</p>
<ul class="govuk-list govuk-list--bullet">
<li>you need to see the data in context</li>
<li>you have a smaller file, with a few errors</li>
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span>
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">Are you sure you want to upload all logs from this bulk upload?</h1>
<h1 class="govuk-heading-l">You have chosen to upload all logs from this bulk upload.</h1>
<p class="govuk-body">There are <%= pluralize(@bulk_upload.logs.count, "log") %> in this bulk upload, and <%= pluralize(@bulk_upload.bulk_upload_errors.count, "unexpected answer") %> will be marked as correct.</p>
The following logs are from your recent bulk upload. They have some incorrect or incomplete data. You’ll need to answer a few more questions for each one to mark them as complete.
You have uploaded <%= pluralize(@bulk_upload.logs.count, "log") %>. There are errors in <%= pluralize(@bulk_upload.logs_with_errors_count, "log") %>, and <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in total. Select the log to fix the errors.
must_be_16_19:"Person must be aged 16-19 if they are a student and have relationship ‘child’"
must_be_16_19:"Person must be aged 16-19 if they are a student and have relationship ‘child’"
partner_under_16:"Cannot be under 16 if the relationship is partner"
partner_under_16:"Cannot be under 16 if the relationship is partner"
lead:
lead:
over_20:"The lead tenant must be under 20 as you told us their housing situation immediately before this letting was a children’s home or foster care"
over_25:"The lead tenant must be under 26 as you told us their housing situation immediately before this letting was a children’s home or foster care"
ecstat:
ecstat:
retired_over_70:"Person %{person_num} must be retired if over 70"
retired_over_70:"Person %{person_num} must be retired if over 70"
child_under_16:"Person %{person_num}’s working situation must be ‘child under 16’ as you told us they’re under 16"
child_under_16:"Person %{person_num}’s working situation must be ‘child under 16’ as you told us they’re under 16"
@ -476,7 +476,7 @@ en:
no_and_dont_know_disabled_needs_conjunction:"No disabled access needs and don’t know disabled access needs cannot be selected together"
no_and_dont_know_disabled_needs_conjunction:"No disabled access needs and don’t know disabled access needs cannot be selected together"
prevten:
prevten:
non_temp_accommodation:"Answer cannot be non-temporary accommodation as this is a re-let to a tenant who occupied the same property as temporary accommodation"
non_temp_accommodation:"Answer cannot be non-temporary accommodation as this is a re-let to a tenant who occupied the same property as temporary accommodation"
over_20_foster_care:"Answer cannot be a children’s home or foster care as the lead tenant is 20 or older"
over_25_foster_care:"Answer cannot be a children’s home or foster care as the lead tenant is 26 or older"
male_refuge:"Answer cannot be a refuge as the lead tenant identifies as male"
male_refuge:"Answer cannot be a refuge as the lead tenant identifies as male"
internal_transfer:"Answer cannot be %{prevten} as this tenancy is an internal transfer"
internal_transfer:"Answer cannot be %{prevten} as this tenancy is an internal transfer"
expect(response.body).toinclude("Are you sure you want to upload all logs from this bulk upload?")
expect(response.body).toinclude("You have chosen to upload all logs from this bulk upload.")
expect(response.body).toinclude("There are 2 logs in this bulk upload, and 2 unexpected answers will be marked as correct.")
expect(response.body).toinclude("You will upload 2 logs. There are unexpected answers in 2 logs, and 2 unexpected answers in total. These unexpected answers will be marked as correct.")
@ -98,8 +98,8 @@ RSpec.describe BulkUploadSalesSoftValidationsCheckController, type: :request do
expect(response).tobe_successful
expect(response).tobe_successful
expect(response.body).toinclude("Are you sure you want to upload all logs from this bulk upload?")
expect(response.body).toinclude("You have chosen to upload all logs from this bulk upload.")
expect(response.body).toinclude("There are 2 logs in this bulk upload, and 2 unexpected answers will be marked as correct.")
expect(response.body).toinclude("You will upload 2 logs. There are unexpected answers in 2 logs, and 2 unexpected answers in total. These unexpected answers will be marked as correct.")
expect(logger).toreceive(:warn).with(/Removing prevten with error: Answer cannot be a children’s home or foster care as the lead tenant is 20 or older/)
expect(logger).toreceive(:warn).with(/Removing prevten with error: Answer cannot be a children’s home or foster care as the lead tenant is 26 or older/)
expect(logger).toreceive(:warn).with(/Removing age1 with error: Answer cannot be a children’s home or foster care as the lead tenant is 20 or older/)
expect(logger).toreceive(:warn).with(/Removing age1 with error: Answer cannot be a children’s home or foster care as the lead tenant is 26 or older/)