Browse Source

CLDC-3862 Update potential errors wording (#2933)

* Update potential errors wording

* More content updates

* Update test
CLDC-3845-bu-new-builds-address v0.4.98
kosiakkatrina 2 weeks ago committed by GitHub
parent
commit
637f1fb890
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      app/components/bulk_upload_error_row_component.html.erb
  2. 2
      app/components/bulk_upload_summary_component.html.erb
  3. 2
      app/helpers/tag_helper.rb
  4. 2
      app/mailers/bulk_upload_mailer.rb
  5. 1
      app/models/bulk_upload_error.rb
  6. 3
      app/views/bulk_upload_lettings_results/show.html.erb
  7. 3
      app/views/bulk_upload_sales_results/show.html.erb
  8. 2
      spec/components/bulk_upload_error_row_component_spec.rb
  9. 4
      spec/components/bulk_upload_summary_component_spec.rb
  10. 2
      spec/mailers/bulk_upload_mailer_spec.rb

6
app/components/bulk_upload_error_row_component.html.erb

@ -37,14 +37,14 @@
<% end %> <% end %>
<% if potential_errors.any? %> <% if potential_errors.any? %>
<h2 class="govuk-heading-m">Potential errors</h2> <h2 class="govuk-heading-m">Confirmation needed</h2>
<p class="govuk-body">The following groups of cells might have conflicting data. Check the answers and fix any incorrect data.<br><br>If the answers are correct, fix the critical errors and upload the file again. You'll need to confirm that the following data is correct when the file only contains potential errors.</p> <p class="govuk-body">Potential data discrepancies exist in the following cells.<br><br>Please resolve all critical errors and review the cells with data discrepancies before re-uploading the file. Bulk confirmation of potential discrepancies is accessible only after all critical errors have been resolved.</p>
<%= govuk_table(html_attributes: { class: "no-bottom-border" }) do |table| %> <%= govuk_table(html_attributes: { class: "no-bottom-border" }) do |table| %>
<%= table.with_head do |head| %> <%= table.with_head do |head| %>
<% head.with_row do |row| %> <% head.with_row do |row| %>
<% row.with_cell(header: true, text: "Cell") %> <% row.with_cell(header: true, text: "Cell") %>
<% row.with_cell(header: true, text: "Question") %> <% row.with_cell(header: true, text: "Question") %>
<% row.with_cell(header: true, text: "Potential error") %> <% row.with_cell(header: true, text: "Confirmation needed") %>
<% row.with_cell(header: true, text: "Specification") %> <% row.with_cell(header: true, text: "Specification") %>
<% end %> <% end %>
<% end %> <% end %>

2
app/components/bulk_upload_summary_component.html.erb

@ -28,7 +28,7 @@
[bulk_upload.total_logs_count, "total log"], [bulk_upload.total_logs_count, "total log"],
[setup_errors_count, "error on important questions", "errors on important questions"], [setup_errors_count, "error on important questions", "errors on important questions"],
[critical_errors_count, "critical error"], [critical_errors_count, "critical error"],
[potential_errors_count, "potential error"], [potential_errors_count, "confirmation needed", "confirmations needed"],
) %> ) %>
</div> </div>
<% end %> <% end %>

2
app/helpers/tag_helper.rb

@ -24,7 +24,7 @@ module TagHelper
processing_error: "Error processing CSV", processing_error: "Error processing CSV",
important_errors: "Errors on important questions in CSV", important_errors: "Errors on important questions in CSV",
critical_errors: "Critical errors in CSV", critical_errors: "Critical errors in CSV",
potential_errors: "Potential errors in CSV", potential_errors: "Confirmation needed in CSV",
logs_uploaded_with_errors: "Logs uploaded with errors", logs_uploaded_with_errors: "Logs uploaded with errors",
errors_fixed_in_service: "Errors fixed on site", errors_fixed_in_service: "Errors fixed on site",
logs_uploaded_no_errors: "Logs uploaded with no errors", logs_uploaded_no_errors: "Logs uploaded with no errors",

2
app/mailers/bulk_upload_mailer.rb

@ -29,7 +29,7 @@ class BulkUploadMailer < NotifyMailer
def send_check_soft_validations_mail(bulk_upload:) def send_check_soft_validations_mail(bulk_upload:)
title = "Check your file data" title = "Check your file data"
description = "Some of your #{bulk_upload.year_combo} #{bulk_upload.log_type} data might not be right. Click the link below to review the potential errors, and check your file to see if the data is correct." description = "We’ve identified potential discrepancies in your #{bulk_upload.year_combo} #{bulk_upload.log_type} data. Please review the flagged information via the link below and cross-reference it with your records to confirm data accuracy."
cta_link = if bulk_upload.lettings? cta_link = if bulk_upload.lettings?
bulk_upload_lettings_soft_validations_check_url(bulk_upload, page: "confirm-soft-errors") bulk_upload_lettings_soft_validations_check_url(bulk_upload, page: "confirm-soft-errors")
else else

1
app/models/bulk_upload_error.rb

@ -6,6 +6,7 @@ class BulkUploadError < ApplicationRecord
scope :order_by_col, -> { order(Arel.sql("LPAD(col, 10, '0')")) } scope :order_by_col, -> { order(Arel.sql("LPAD(col, 10, '0')")) }
scope :important, -> { where(category: "setup") } scope :important, -> { where(category: "setup") }
scope :potential, -> { where(category: "soft_validation") } scope :potential, -> { where(category: "soft_validation") }
scope :not_potential, -> { where.not(category: "soft_validation").or(where(category: nil)) }
scope :critical, -> { where(category: nil).or(where.not(category: %w[setup soft_validation])) } scope :critical, -> { where(category: nil).or(where.not(category: %w[setup soft_validation])) }
scope :critical_or_important, -> { critical.or(important) } scope :critical_or_important, -> { critical.or(important) }
end end

3
app/views/bulk_upload_lettings_results/show.html.erb

@ -7,7 +7,8 @@
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<span class="govuk-caption-l">Upload lettings logs in bulk (<%= @bulk_upload.year_combo %>)</span> <span class="govuk-caption-l">Upload lettings logs in bulk (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file</h1> <% error_word = @bulk_upload.bulk_upload_errors.not_potential.any? ? "error" : "discrepancy" %>
<h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, error_word) %> in your file</h1>
<div class="govuk-body"> <div class="govuk-body">
Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadForm::PrepareYourFile.new(year: @bulk_upload.year, log_type: "lettings").specification_path, target: "_blank" %> to help you fix the cells in your CSV file. Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadForm::PrepareYourFile.new(year: @bulk_upload.year, log_type: "lettings").specification_path, target: "_blank" %> to help you fix the cells in your CSV file.

3
app/views/bulk_upload_sales_results/show.html.erb

@ -7,7 +7,8 @@
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<span class="govuk-caption-l">Upload sales logs in bulk (<%= @bulk_upload.year_combo %>)</span> <span class="govuk-caption-l">Upload sales logs in bulk (<%= @bulk_upload.year_combo %>)</span>
<h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file</h1> <% error_word = @bulk_upload.bulk_upload_errors.not_potential.any? ? "error" : "discrepancy" %>
<h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, error_word) %> in your file</h1>
<div class="govuk-body"> <div class="govuk-body">
Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadForm::PrepareYourFile.new(year: @bulk_upload.year, log_type: "sales").specification_path, target: "_blank" %> to help you fix the cells in your CSV file. Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadForm::PrepareYourFile.new(year: @bulk_upload.year, log_type: "sales").specification_path, target: "_blank" %> to help you fix the cells in your CSV file.

2
spec/components/bulk_upload_error_row_component_spec.rb

@ -148,7 +148,7 @@ RSpec.describe BulkUploadErrorRowComponent, type: :component do
it "renders the potential errors section" do it "renders the potential errors section" do
result = render_inline(described_class.new(bulk_upload_errors:)) result = render_inline(described_class.new(bulk_upload_errors:))
expect(result).to have_content("Potential errors") expect(result).to have_content("Confirmation needed")
end end
it "renders the potential error message" do it "renders the potential error message" do

4
spec/components/bulk_upload_summary_component_spec.rb

@ -64,8 +64,8 @@ RSpec.describe BulkUploadSummaryComponent, type: :component do
it "shows the potential errors status and error count" do it "shows the potential errors status and error count" do
result = render_inline(described_class.new(bulk_upload:)) result = render_inline(described_class.new(bulk_upload:))
expect(result).to have_content("Potential errors in CSV") expect(result).to have_content("Confirmation needed in CSV")
expect(result).to have_content("2 potential errors") expect(result).to have_content("2 confirmations needed")
expect(result).to have_content("16 total logs") expect(result).to have_content("16 total logs")
expect(result).to have_no_content("errors on important") expect(result).to have_no_content("errors on important")
expect(result).to have_no_content("critical") expect(result).to have_no_content("critical")

2
spec/mailers/bulk_upload_mailer_spec.rb

@ -113,7 +113,7 @@ RSpec.describe BulkUploadMailer do
title: "Check your file data", title: "Check your file data",
filename: bulk_upload.filename, filename: bulk_upload.filename,
upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time), upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time),
description: "Some of your #{bulk_upload.year_combo} lettings data might not be right. Click the link below to review the potential errors, and check your file to see if the data is correct.", description: "We’ve identified potential discrepancies in your #{bulk_upload.year_combo} lettings data. Please review the flagged information via the link below and cross-reference it with your records to confirm data accuracy.",
cta_link: bulk_upload_lettings_soft_validations_check_url(bulk_upload, page: "confirm-soft-errors"), cta_link: bulk_upload_lettings_soft_validations_check_url(bulk_upload, page: "confirm-soft-errors"),
}, },
) )

Loading…
Cancel
Save