diff --git a/app/helpers/logs_helper.rb b/app/helpers/logs_helper.rb index 5e7b73d26..71b345c91 100644 --- a/app/helpers/logs_helper.rb +++ b/app/helpers/logs_helper.rb @@ -66,10 +66,10 @@ module LogsHelper end def deleted_errors_warning_text(bulk_upload) - unique_field_count = bulk_upload.bulk_upload_errors.uniq { |e| e.field }.count + unique_field_count = bulk_upload.bulk_upload_errors.uniq(&:field).count this_or_these = unique_field_count == 1 ? "this" : "these" it_is_or_they_are = unique_field_count == 1 ? "it is" : "they are" - "#{pluralize(unique_field_count, "answer")} will be deleted because #{it_is_or_they_are} invalid. You will have to answer #{this_or_these} #{"question".pluralize(unique_field_count)} again on the site." + "#{pluralize(unique_field_count, 'answer')} will be deleted because #{it_is_or_they_are} invalid. You will have to answer #{this_or_these} #{'question'.pluralize(unique_field_count)} again on the site." end end diff --git a/app/views/bulk_upload_lettings_results/deletion_report.html.erb b/app/views/bulk_upload_lettings_results/deletion_report.html.erb index eed82a98d..b71dad333 100644 --- a/app/views/bulk_upload_lettings_results/deletion_report.html.erb +++ b/app/views/bulk_upload_lettings_results/deletion_report.html.erb @@ -1,7 +1,7 @@
Bulk upload for lettings (<%= @bulk_upload.year_combo %>) -

<%= @bulk_upload.bulk_upload_errors.uniq { |e| e.field }.count == 1 ? "This" : "These" %> <%= pluralize(@bulk_upload.bulk_upload_errors.uniq { |e| e.field }.count, "answer") %> will be deleted if you upload the <%= "log".pluralize(@bulk_upload.logs.count) %>

+

<%= @bulk_upload.bulk_upload_errors.uniq(&:field).count == 1 ? "This" : "These" %> <%= pluralize(@bulk_upload.bulk_upload_errors.uniq(&:field).count, "answer") %> will be deleted if you upload the <%= "log".pluralize(@bulk_upload.logs.count) %>

The following cells contain data this is incorrect.

If you upload the logs, these answers will be deleted. You will have to re-enter the data on the site and resolve these errors.

diff --git a/app/views/bulk_upload_lettings_resume/confirm.html.erb b/app/views/bulk_upload_lettings_resume/confirm.html.erb index cd7b0b4ed..9d839576d 100644 --- a/app/views/bulk_upload_lettings_resume/confirm.html.erb +++ b/app/views/bulk_upload_lettings_resume/confirm.html.erb @@ -12,7 +12,6 @@ <%= govuk_link_to "View the error report", deletion_report_bulk_upload_lettings_result_path %>

- <%= govuk_warning_text do %> <%= deleted_errors_warning_text(@bulk_upload) %> <%= govuk_link_to "See which answers will be deleted", deletion_report_bulk_upload_lettings_result_path %>