hide shipping icons from suppliers

This commit is contained in:
Ahmed Ejaz
2025-03-23 16:15:52 +05:00
parent eee5d5c8ad
commit 4e2198cd4f
2 changed files with 7 additions and 1 deletions

View File

@@ -47,7 +47,7 @@
- if local_assigns[:success]
%i.success.icon-ok-sign{"data-controller": "ephemeral"}
= render AdminTooltipComponent.new(text: t('spree.admin.orders.index.edit'), link_text: "", link: edit_admin_order_path(order), link_class: "icon_link with-tip icon-edit no-text")
- if order.ready_to_ship?
- if spree_current_user.can_manage_orders? && order.ready_to_ship?
%form
= render ShipOrderComponent.new(order: order)
= render partial: 'admin/shared/tooltip_button', locals: {button_class: "icon-road icon_link with-tip no-text", reflex_data_id: order.id.to_s, tooltip_text: t('spree.admin.orders.index.ship'), shipment: true}

View File

@@ -83,6 +83,12 @@ RSpec.describe 'As a producer who have the ability to update orders' do
expect(page).to have_selector('tr', count: 1) # Only one order
expect(page).to have_selector('td', text: name, count: 1)
expect(page).to have_selector('td', text: email, count: 1)
within 'td.actions' do
# to have edit button
expect(page).to have_selector("a.icon-edit")
# not to have ship button
expect(page).not_to have_selector('button.icon-road')
end
end
end
end