From bee90d6f9964c7e981baea80b1e07ce52f71ea31 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:34:30 +0100 Subject: [PATCH] CLDC-2588++update soft validation errors in bulk upload (#2577) * Change table column width with govuk class * Add html_safe to error message fields --- app/components/bulk_upload_error_row_component.html.erb | 8 ++++---- .../bulk_upload_error_summary_table_component.html.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/components/bulk_upload_error_row_component.html.erb b/app/components/bulk_upload_error_row_component.html.erb index 4e9ff1390..9447c9d37 100644 --- a/app/components/bulk_upload_error_row_component.html.erb +++ b/app/components/bulk_upload_error_row_component.html.erb @@ -24,8 +24,8 @@ <% critical_errors.each do |error| %> <% body.with_row do |row| %> <% row.with_cell(text: error.cell) %> - <% row.with_cell(text: question_for_field(error.field)) %> - <% row.with_cell(text: error.error, html_attributes: { class: "govuk-!-font-weight-bold" }) %> + <% row.with_cell(text: question_for_field(error.field), html_attributes: { class: "govuk-!-width-one-half" }) %> + <% row.with_cell(text: error.error.html_safe, html_attributes: { class: "govuk-!-font-weight-bold govuk-!-width-one-half" }) %> <% row.with_cell(text: error.field.humanize) %> <% end %> <% end %> @@ -54,9 +54,9 @@ <% row_class += " last-row" if index == errors.size - 1 %> <% body.with_row(html_attributes: { class: row_class }) do |row| %> <% row.with_cell(text: error.cell) %> - <% row.with_cell(text: question_for_field(error.field)) %> + <% row.with_cell(text: question_for_field(error.field), html_attributes: { class: "govuk-!-width-one-half" }) %> <% if index == 0 %> - <% row.with_cell(text: error_message, rowspan: errors.size, html_attributes: { class: "govuk-!-font-weight-bold grouped-multirow-cell" }) %> + <% row.with_cell(text: error_message.html_safe, rowspan: errors.size, html_attributes: { class: "govuk-!-font-weight-bold govuk-!-width-one-half grouped-multirow-cell" }) %> <% end %> <% row.with_cell(text: error.field.humanize) %> <% end %> diff --git a/app/components/bulk_upload_error_summary_table_component.html.erb b/app/components/bulk_upload_error_summary_table_component.html.erb index c0e10cffa..f9b42f34d 100644 --- a/app/components/bulk_upload_error_summary_table_component.html.erb +++ b/app/components/bulk_upload_error_summary_table_component.html.erb @@ -12,7 +12,7 @@ <%= table.with_body do |body| %> <% body.with_row do |row| %> - <% row.with_cell(text: error[0][2]) %> + <% row.with_cell(text: error[0][2].html_safe) %> <% row.with_cell(text: pluralize(error[1], "error"), numeric: true) %> <% end %> <% end %>