From c0cbd1e6888002879d3d602d6e1d91f6101086cf Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Fri, 2 Apr 2021 12:26:59 -0700 Subject: [PATCH] remove new adjustment button for canceled orders --- app/views/spree/admin/adjustments/index.html.haml | 3 ++- spec/features/admin/adjustments_spec.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/spree/admin/adjustments/index.html.haml b/app/views/spree/admin/adjustments/index.html.haml index 4aa8de7967..31d0e9bff9 100644 --- a/app/views/spree/admin/adjustments/index.html.haml +++ b/app/views/spree/admin/adjustments/index.html.haml @@ -6,7 +6,8 @@ = t(:adjustments) - content_for :page_actions do - %li= button_link_to t(:new_adjustment), new_admin_order_adjustment_url(@order), :icon => 'icon-plus' + - unless @order.canceled? + %li= button_link_to t(:new_adjustment), new_admin_order_adjustment_url(@order), :icon => 'icon-plus' = render partial: 'spree/admin/shared/order_links' %li= button_link_to t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left' diff --git a/spec/features/admin/adjustments_spec.rb b/spec/features/admin/adjustments_spec.rb index 2a906824b3..9e6b192bc3 100644 --- a/spec/features/admin/adjustments_spec.rb +++ b/spec/features/admin/adjustments_spec.rb @@ -99,5 +99,6 @@ feature ' click_link 'Adjustments' expect(page).to_not have_selector('tr a.icon-edit') + expect(page).to_not have_selector('a.icon-plus'), text: I18n.t(:new_adjustment) end end