From 3e1e7d3a108de1c11d2f284b6e084e65def14a1f Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 16 May 2024 11:12:13 +1000 Subject: [PATCH] Show error messages and highlight for bulk editing The validation message is on "tax_category", so labels and error messages can use that to show the error state. But the select field has to be "tax_category_id" to work. --- app/views/admin/products_v3/_variant_row.html.haml | 1 + app/views/spree/admin/variants/_form.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/admin/products_v3/_variant_row.html.haml b/app/views/admin/products_v3/_variant_row.html.haml index 53ea27aad5..98920c72b6 100644 --- a/app/views/admin/products_v3/_variant_row.html.haml +++ b/app/views/admin/products_v3/_variant_row.html.haml @@ -56,6 +56,7 @@ include_blank: t('.none_tax_category'), aria_label: t('.tax_category_field_name'), placeholder_value: t('.search_for_tax_categories'))) + = error_message_on variant, :tax_category %td.align-left -# empty %td.align-right diff --git a/app/views/spree/admin/variants/_form.html.haml b/app/views/spree/admin/variants/_form.html.haml index 76a1ebfafc..f90f15c1f7 100644 --- a/app/views/spree/admin/variants/_form.html.haml +++ b/app/views/spree/admin/variants/_form.html.haml @@ -65,7 +65,7 @@ = f.number_field field, value: value, class: 'fullwidth', step: 0.01 .field - = f.label :tax_category_id, t(:tax_category) + = f.label :tax_category, t(:tax_category), for: :tax_category_id = f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t(:none) }, { class: 'select2 fullwidth' }) .field