From a5407d780c6a60d80a09724dcd6369cdddbde8e9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 18 Nov 2018 20:41:07 +0000 Subject: [PATCH 1/2] Include unexpected validation errors --- app/models/product_import/product_importer.rb | 3 ++- app/views/admin/product_import/_errors_list.html.haml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/product_import/product_importer.rb b/app/models/product_import/product_importer.rb index 3bc66fa815..3b8671290f 100644 --- a/app/models/product_import/product_importer.rb +++ b/app/models/product_import/product_importer.rb @@ -100,7 +100,8 @@ module ProductImport entries[entry.line_number] = { attributes: entry.displayable_attributes, validates_as: entry.validates_as, - errors: entry.invalid_attributes + errors: entry.invalid_attributes, + product_validations: entry.product_validations } end entries.to_json diff --git a/app/views/admin/product_import/_errors_list.html.haml b/app/views/admin/product_import/_errors_list.html.haml index 787aabe76b..8397c7013b 100644 --- a/app/views/admin/product_import/_errors_list.html.haml +++ b/app/views/admin/product_import/_errors_list.html.haml @@ -7,3 +7,5 @@ ( {{entry.attributes.display_name}} ) %p.error{ng: {repeat: "(attribute, error) in entry.errors", show: "ignore_fields.indexOf(attribute) < 0" }}  -  {{error}} + %p.error{ng: {repeat: "(attribute, error) in entry.product_validations"}} +  -  {{error}} From b3a9b502fa6e2c0db91670089b3e874365705e91 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 18 Nov 2018 21:16:17 +0000 Subject: [PATCH 2/2] Add missing translation key --- config/locales/en.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 34d4584439..41a1157759 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2395,6 +2395,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using validation_msg_relationship_already_established: "^That relationship is already established." validation_msg_at_least_one_hub: "^At least one hub must be selected" validation_msg_product_category_cant_be_blank: "^Product Category cant be blank" + validation_msg_tax: "^Tax Category is required" validation_msg_tax_category_cant_be_blank: "^Tax Category can't be blank" validation_msg_is_associated_with_an_exising_customer: "is associated with an existing customer" content_configuration_pricing_table: "(TODO: Pricing table)"