solidus_backend 3.2.1 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17e98837af337f5255926cb548c111a842b74df3d4d2c08bf53b495d3363b496
4
- data.tar.gz: 623f45cea7da431a725a43fddbbdefa82d39e329a1839d94c7739da82c3ffa71
3
+ metadata.gz: ff3b0be31692e952e9756dd6d02e2156cd328f6d8f95eeda5ef8f6d8e12e22da
4
+ data.tar.gz: bcfecf645946ce5324b3b8ce001a7fd7a4d38da8db3e18738e3e4cee183830f2
5
5
  SHA512:
6
- metadata.gz: 1d4253ccbbac04ec3821a33dc5b1263639af936ad6b91092d4b0524718d7ff0af8e08909f3c1244e76457b47c5c5644f0a256d9d2bcf7ba2dcb49129d0291771
7
- data.tar.gz: afb9189394a18f2246df9b141e387d7f1d06ceba92627546f773a8b9e3dbaf4a220c50148bb724fb6cd77aba3bf1b1f0bf03b6a3029422b582b9a8d84737aef2
6
+ metadata.gz: 76b6ac3adcdf770abf436e0a530a94e61a0ba666eaf6f8272d7a08bb1437eddeeaefc472b5e6b099943b5fc791005c6cb67706573d01c14025040108fa4f00ba
7
+ data.tar.gz: 414a0910cb90706ae48f73173ec6eb7546b748b0ca2f2a5cf6dee77ee0974ece835bee35faa9d4acb46800caf31a6d9e5b380f9a785e8f7fb3e422968cd38cc4
@@ -56,7 +56,7 @@ Spree.Models.ImageUpload = Backbone.Model.extend({
56
56
  processData: false, // tell jQuery not to process the data
57
57
  contentType: false, // tell jQuery not to set contentType
58
58
  xhr: function () {
59
- var xhr = $.ajaxSettings.xhr();
59
+ var xhr = $.ajaxSetup.xhr(); // Using default ajax builder but inputting upload settings
60
60
  if (xhr.upload) {
61
61
  xhr.upload.onprogress = function (event) {
62
62
  if (event.lengthComputable) {
@@ -67,9 +67,9 @@ Spree.Models.ImageUpload = Backbone.Model.extend({
67
67
  }
68
68
  return xhr;
69
69
  }
70
- }).done(function() {
70
+ }).then(function() {
71
71
  that.set({progress: 100})
72
- }).error(function(jqXHR, textStatus, errorThrown) {
72
+ }).fail(function() {
73
73
  that.set({serverError: true});
74
74
  });
75
75
  }
@@ -100,30 +100,26 @@ var ShipmentSplitItemView = Backbone.View.extend({
100
100
  variant_id: this.variant.id,
101
101
  quantity: quantity
102
102
  };
103
- var jqXHR;
103
+ var path;
104
104
  if (target_type == 'stock_location') {
105
105
  // transfer to a new location
106
106
  split_attr.stock_location_id = target_id;
107
- jqXHR = Spree.ajax({
108
- type: "POST",
109
- url: Spree.pathFor('api/shipments/transfer_to_location'),
110
- data: split_attr
111
- });
107
+ path = Spree.pathFor("api/shipments/transfer_to_location");
112
108
  } else if (target_type == 'shipment') {
113
109
  // transfer to an existing shipment
114
110
  split_attr.target_shipment_number = target_id;
115
- jqXHR = Spree.ajax({
116
- type: "POST",
117
- url: Spree.pathFor('api/shipments/transfer_to_shipment'),
118
- data: split_attr
119
- });
111
+ path = Spree.pathFor('api/shipments/transfer_to_shipment');
120
112
  } else {
121
113
  alert('Please select the split destination.');
122
114
  return false;
123
115
  }
124
- jqXHR.error(function(msg) {
116
+ Spree.ajax({
117
+ type: "POST",
118
+ url: path,
119
+ data: split_attr
120
+ }).fail(function(msg) {
125
121
  alert(Spree.t("split_failed"));
126
- }).done(function(response) {
122
+ }).then(function(response) {
127
123
  if (response.success) {
128
124
  window.Spree.advanceOrder();
129
125
  } else {
@@ -32,7 +32,8 @@
32
32
  data: function(term, page) {
33
33
  var searchData = {
34
34
  variant_search_term: term,
35
- token: Spree.api_key
35
+ token: Spree.api_key,
36
+ page: page
36
37
  };
37
38
  return _.extend(searchData, searchOptions);
38
39
  },
@@ -40,7 +41,8 @@
40
41
  results: function(data, page) {
41
42
  window.variants = data["variants"];
42
43
  return {
43
- results: data["variants"]
44
+ results: data["variants"],
45
+ more: data.current_page * data.per_page < data.total_count
44
46
  };
45
47
  }
46
48
  },
@@ -103,10 +103,6 @@ module Spree
103
103
  attributes |= [:email]
104
104
  end
105
105
 
106
- if can? :manage, Spree::Role
107
- attributes += [{ spree_role_ids: [] }]
108
- end
109
-
110
106
  if can? :manage, Spree::StockLocation
111
107
  attributes += [{ stock_location_ids: [] }]
112
108
  end
@@ -142,9 +138,13 @@ module Spree
142
138
  end
143
139
 
144
140
  def set_roles
145
- if user_params[:spree_role_ids]
146
- @user.spree_roles = Spree::Role.accessible_by(current_ability).where(id: user_params[:spree_role_ids])
147
- end
141
+ roles_ids = params[:user][:spree_role_ids]
142
+ return unless roles_ids
143
+
144
+ @user.update_spree_roles(
145
+ Spree::Role.where(id: roles_ids),
146
+ ability: current_ability
147
+ )
148
148
  end
149
149
 
150
150
  def set_stock_locations
@@ -439,7 +439,7 @@ disabled look for disabled choices in the results dropdown
439
439
  }
440
440
 
441
441
  .select2-more-results.select2-active {
442
- background: #f4f4f4 image-url('solidus_admin/select2-spinner.gif') no-repeat 100%;
442
+ background: #f4f4f4 image-url('solidus_admin/select2-spinner.gif') no-repeat 95% center;
443
443
  }
444
444
 
445
445
  .select2-results .select2-ajax-error {
@@ -449,6 +449,7 @@ disabled look for disabled choices in the results dropdown
449
449
  .select2-more-results {
450
450
  background: #f4f4f4;
451
451
  display: list-item;
452
+ padding: 0.5em 1em
452
453
  }
453
454
 
454
455
  /* disabled styles */
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-09 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.1
19
+ version: 3.2.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.1
26
+ version: 3.2.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: solidus_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.1
33
+ version: 3.2.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.1
40
+ version: 3.2.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: font-awesome-rails
43
43
  requirement: !ruby/object:Gem::Requirement