From 51189a3138cc6d6d26061d535da66b78a51b7cad Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 6 Jul 2023 09:50:05 +1000 Subject: [PATCH 1/4] [table] Hide properties for variant row These were a duplicate of the product. --- app/views/admin/products_v3/_table.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/products_v3/_table.html.haml b/app/views/admin/products_v3/_table.html.haml index f5f14fad7d..30bcb7e4ad 100644 --- a/app/views/admin/products_v3/_table.html.haml +++ b/app/views/admin/products_v3/_table.html.haml @@ -59,9 +59,9 @@ %td.align-left .line-clamp-1= variant.product.supplier.name # same as product %td.align-left - .line-clamp-1= variant.product.taxons.map(&:name).join(', ') # same as product + -# empty %td.align-left - .line-clamp-1= variant.tax_category&.name + -# empty %td.align-left - .line-clamp-1= variant.product.inherits_properties ? 'YES' : 'NO' # same as product + -# empty From ea93800ee68ebb9bf51cd4f9f0bce31f5426b419 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 6 Jul 2023 09:51:27 +1000 Subject: [PATCH 2/4] [table] Tax category: display None instead of blank --- app/views/admin/products_v3/_table.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/products_v3/_table.html.haml b/app/views/admin/products_v3/_table.html.haml index 30bcb7e4ad..a1b8b9fd6c 100644 --- a/app/views/admin/products_v3/_table.html.haml +++ b/app/views/admin/products_v3/_table.html.haml @@ -41,7 +41,7 @@ %td.align-left .line-clamp-1= product.taxons.map(&:name).join(', ') %td.align-left - .line-clamp-1= product.tax_category&.name + .line-clamp-1= product.tax_category&.name || "None" # TODO: convert to dropdown, else translate hardcoded string. %td.align-left .line-clamp-1= product.inherits_properties ? 'YES' : 'NO' #TODO: consider using https://github.com/RST-J/human_attribute_values, else use I18n.t (also below) - product.variants.each do |variant| From 439c0a8e184e592b30a084f53ecc1a7ae863bb33 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 4 Jul 2023 15:28:54 +1000 Subject: [PATCH 3/4] Remove unnecessary match_path options Spree::Tab already knows when to highlight these, based on the controller name. It even handles sub-paths like '/admin/products/garlic/edit'. --- app/views/spree/admin/shared/_product_sub_menu.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/spree/admin/shared/_product_sub_menu.html.haml b/app/views/spree/admin/shared/_product_sub_menu.html.haml index 41a3f5b3b7..e3641cbf62 100644 --- a/app/views/spree/admin/shared/_product_sub_menu.html.haml +++ b/app/views/spree/admin/shared/_product_sub_menu.html.haml @@ -1,8 +1,8 @@ - content_for :sub_menu do %ul#sub_nav.inline-menu - = tab :products, match_path: '/products' + = tab :products = tab :properties = tab :variant_overrides, url: main_app.admin_inventory_path, match_path: '/inventory' = tab :import, url: main_app.admin_product_import_path, match_path: '/product_import' - if feature?(:new_products_page, spree_current_user) - = tab :new_products, url: main_app.admin_new_products_path, match_path: '/new_products' + = tab :new_products, url: main_app.admin_new_products_path From 8ef73906db7e28ff11a6e2785e44a6ba44e6921c Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 4 Jul 2023 15:30:02 +1000 Subject: [PATCH 4/4] Show products_v3 in the submenu It's not translated, but that doesn't matter, it's just a shortcut while we're developing it. --- app/views/spree/admin/shared/_product_sub_menu.html.haml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/spree/admin/shared/_product_sub_menu.html.haml b/app/views/spree/admin/shared/_product_sub_menu.html.haml index e3641cbf62..f9cd83d9b4 100644 --- a/app/views/spree/admin/shared/_product_sub_menu.html.haml +++ b/app/views/spree/admin/shared/_product_sub_menu.html.haml @@ -6,3 +6,5 @@ = tab :import, url: main_app.admin_product_import_path, match_path: '/product_import' - if feature?(:new_products_page, spree_current_user) = tab :new_products, url: main_app.admin_new_products_path + - if feature?(:admin_style_v3, spree_current_user) + = tab :products_v3, url: main_app.admin_products_v3_path