From 39de2f704f5bd99f4a01f3fc39527a624d4cb93b Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Tue, 28 Nov 2023 15:20:44 +0500 Subject: [PATCH] #11068, add delete dropdown option # Conflicts: # app/views/admin/products_v3/components/_product_actions.html.haml --- app/controllers/spree/admin/products_controller.rb | 2 ++ .../products_v3/components/_product_actions.html.haml | 9 +++++++++ config/locales/en.yml | 1 + 3 files changed, 12 insertions(+) create mode 100644 app/views/admin/products_v3/components/_product_actions.html.haml diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index e153faff38..588b3bb186 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -88,6 +88,8 @@ module Spree redirect_to spree.admin_products_url end + def destroy; end + def group_buy_options @url_filters = ::ProductFilters.new.extract(request.query_parameters) end diff --git a/app/views/admin/products_v3/components/_product_actions.html.haml b/app/views/admin/products_v3/components/_product_actions.html.haml new file mode 100644 index 0000000000..ae114e2b66 --- /dev/null +++ b/app/views/admin/products_v3/components/_product_actions.html.haml @@ -0,0 +1,9 @@ +.vertical-ellipsis-menu{ "data-controller": "vertical-ellipsis-menu" } + %i.fa.fa-ellipsis-v{ "data-action": "click->vertical-ellipsis-menu#toggle" } + .vertical-ellipsis-menu-content{ "data-vertical-ellipsis-menu-target": "content" } + - if defined?(variant) + = link_to t('admin.products_page.actions.edit'), edit_admin_product_variant_path(product, variant), class: "vertical-ellipsis-menu-content-item" + - else + = link_to t('admin.products_page.actions.edit'), edit_admin_product_path(product), class: "vertical-ellipsis-menu-content-item" + = link_to t('admin.products_page.actions.clone'), clone_admin_product_path(product), class: "vertical-ellipsis-menu-content-item" + = link_to t('admin.products_page.actions.delete'), admin_product_path(product), method: :delete, class: "vertical-ellipsis-menu-content-item" diff --git a/config/locales/en.yml b/config/locales/en.yml index b9df0ba1f9..4120e755bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -580,6 +580,7 @@ en: actions: edit: Edit clone: Clone + delete: Delete adjustments: skipped_changing_canceled_order: "You can't change a cancelled order." # Common properties / models