From 15456577a33cdfa2e4d5d50512ca6b51685e890f Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Mon, 25 Feb 2019 22:31:40 +0000 Subject: [PATCH] Remove the button that enables user to split an order between stock locations There's only one stock location in OFN so this feature is not useful at this point --- .../admin/orders/controllers/order_controller.js.coffee | 4 ++++ spec/features/admin/orders_spec.rb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/app/assets/javascripts/admin/orders/controllers/order_controller.js.coffee b/app/assets/javascripts/admin/orders/controllers/order_controller.js.coffee index 822e81eb49..1ba6d96aed 100644 --- a/app/assets/javascripts/admin/orders/controllers/order_controller.js.coffee +++ b/app/assets/javascripts/admin/orders/controllers/order_controller.js.coffee @@ -24,3 +24,7 @@ angular.module("admin.orders").controller "orderCtrl", ($scope, shops, orderCycl for shop in $scope.shops shop.disabled = !$scope.distributorHasOrderCycles(shop) + + # Hides the split button introduced by spree in the order form + # We only have one stock location in OFN so it's meaningless to split the order between stock locations + $('.split-item').hide() diff --git a/spec/features/admin/orders_spec.rb b/spec/features/admin/orders_spec.rb index ea501020d7..64d7ba0d86 100644 --- a/spec/features/admin/orders_spec.rb +++ b/spec/features/admin/orders_spec.rb @@ -285,6 +285,11 @@ feature %q{ end end + scenario "cannot split the order in different stock locations" do + # There's only 1 stock location in OFN, so the split functionality that comes with spree should be hidden + expect(page).to_not have_selector '.split-item' + end + scenario "can edit shipping method" do expect(page).to_not have_content different_shipping_method.name