From d989b8ad2fde49280f69fe22b7da519a2ad579d0 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 24 Nov 2023 16:28:00 +1100 Subject: [PATCH] Remove unnecessary partial Yay, now it's compact enough to fit in the table partial. (Although we should probably try to reduce that one down one day..) --- app/views/admin/products_v3/_table.html.haml | 8 ++++++-- .../products_v3/components/_product_actions.html.haml | 6 ------ 2 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 app/views/admin/products_v3/components/_product_actions.html.haml diff --git a/app/views/admin/products_v3/_table.html.haml b/app/views/admin/products_v3/_table.html.haml index 3c6d40fa74..18009160d6 100644 --- a/app/views/admin/products_v3/_table.html.haml +++ b/app/views/admin/products_v3/_table.html.haml @@ -67,7 +67,10 @@ %td.align-left .content= product.inherits_properties ? 'YES' : 'NO' #TODO: consider using https://github.com/RST-J/human_attribute_values, else use I18n.t (also below) %td.align-right - = render partial: 'admin/products_v3/components/product_actions', locals: { product: product } + = render(VerticalEllipsisMenuComponent.new) do + = link_to t('admin.products_page.actions.edit'), edit_admin_product_path(product) + = link_to t('admin.products_page.actions.clone'), clone_admin_product_path(product) + - product.variants.each do |variant| = form.fields_for("products][][variants_attributes][", variant, index: nil) do |variant_form| %tr.condensed @@ -94,4 +97,5 @@ %td.align-left -# empty %td.align-right - = render partial: 'admin/products_v3/components/product_actions', locals: { product: product, variant: variant } + = render(VerticalEllipsisMenuComponent.new) do + = link_to t('admin.products_page.actions.edit'), edit_admin_product_variant_path(product, variant) diff --git a/app/views/admin/products_v3/components/_product_actions.html.haml b/app/views/admin/products_v3/components/_product_actions.html.haml deleted file mode 100644 index a37221695f..0000000000 --- a/app/views/admin/products_v3/components/_product_actions.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -= render(VerticalEllipsisMenuComponent.new) do - - if defined?(variant) - = link_to t('admin.products_page.actions.edit'), edit_admin_product_variant_path(product, variant) - - else - = link_to t('admin.products_page.actions.edit'), edit_admin_product_path(product) - = link_to t('admin.products_page.actions.clone'), clone_admin_product_path(product)