mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Change shipping_method_id storage: in the query
This commit is contained in:
@@ -16,7 +16,7 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
|
||||
$scope.rowStatus = {}
|
||||
|
||||
QueryPersistence.storageKey = 'ordersFilters'
|
||||
QueryPersistence.storableFilters = ["q", "sorting", "shipping_method_id", "page", "per_page"]
|
||||
QueryPersistence.storableFilters = ["q", "sorting", "page", "per_page"]
|
||||
|
||||
$scope.initialise = ->
|
||||
unless QueryPersistence.restoreFilters($scope)
|
||||
@@ -48,7 +48,7 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
|
||||
'q[distributor_id_in][]': $scope.q?.distributor_id_in,
|
||||
'q[order_cycle_id_in][]': $scope.q?.order_cycle_id_in,
|
||||
'q[s]': $scope.sorting || 'completed_at desc',
|
||||
shipping_method_id: $scope.shipping_method_id,
|
||||
shipping_method_id: $scope.q?.shipping_method_id,
|
||||
per_page: $scope.per_page,
|
||||
page: page
|
||||
}
|
||||
|
||||
@@ -35,8 +35,9 @@
|
||||
.field
|
||||
= label_tag nil, t(:shipping_method)
|
||||
= select_tag("shipping_method_id",
|
||||
= select_tag("q[shipping_method_id]",
|
||||
options_for_select(Spree::ShippingMethod.managed_by(spree_current_user).collect {|s| [t("spree.shipping_method_names.#{s.name}"), s.id]}),
|
||||
{include_blank: true, class: 'select2', 'ng-model' => 'shipping_method_id', 'ng-value' => 'shipping_method_id'})
|
||||
{include_blank: true, class: 'select2', 'ng-model': 'q.shipping_method_id'})
|
||||
.field-block.alpha.eight.columns
|
||||
= label_tag nil, t(:distributors)
|
||||
= select_tag("q[distributor_id_in]",
|
||||
|
||||
@@ -134,7 +134,7 @@ feature '
|
||||
fill_in "Invoice number", with: "R123456"
|
||||
select2_select order_cycle.name, from: 'q_order_cycle_id_in'
|
||||
select2_select distributor.name, from: 'q_distributor_id_in'
|
||||
select2_select shipping_method.name, from: 'shipping_method_id'
|
||||
select2_select shipping_method.name, from: 'q_shipping_method_id'
|
||||
select2_select "complete", from: 'q_state_eq'
|
||||
fill_in "Email", with: user.email
|
||||
fill_in "First name begins with", with: "J"
|
||||
@@ -151,7 +151,7 @@ feature '
|
||||
# Check every filters to be equal
|
||||
expect(find_field("Only show complete orders")).not_to be_checked
|
||||
expect(find_field("Invoice number").value).to eq "R123456"
|
||||
expect(find("#s2id_shipping_method_id").text).to eq shipping_method.name
|
||||
expect(find("#s2id_q_shipping_method_id").text).to eq shipping_method.name
|
||||
expect(find("#s2id_q_state_eq").text).to eq "complete"
|
||||
expect(find_field("Email").value).to eq user.email
|
||||
expect(find_field("First name begins with").value).to eq "J"
|
||||
|
||||
Reference in New Issue
Block a user