solidus_frontend 2.11.7 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_frontend might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fde8bbc2769e900496781f11efd3cabe66e289ad144628a836a91d03731f991
4
- data.tar.gz: d8ec75e27e0b2160fbc2dafc6a0f45fec1fe8788b01f11ef64892dd07998676e
3
+ metadata.gz: cf5e18acd4c8ecbcf2cf401eb50c46e6d6b5bd84c7ffe3704c0b298f1308c574
4
+ data.tar.gz: 5f9cb36908fb080589a39cebf70da10c7ff38d2a023ee418e858aa73457dec58
5
5
  SHA512:
6
- metadata.gz: a6c0551f408f61e1fb4c4d0e9cccd2cc0c39e31ab14b893f4a0c322edf65cfbdedfd394bee42e40a7ad154cebbb7963d3ee9f2ee2bbba8f75bf6c3aea7343182
7
- data.tar.gz: 4af7e9c9c880d27e691524196852522f7703137b5ba2425c81d3ed2b248492a5feedd6fac20ec93b790d3fb5af6e4970c85f5a6d940c2aceaf650e7f1c153e34
6
+ metadata.gz: 8fd1a9c0f68b3f5e67644ba34f861ecbb5b3ce87b63c5aded1f5c490d6bd8a5dc06f6879e44bb330d14a923b70c05aff4097d85b82926f52bc61c1cd47d79733
7
+ data.tar.gz: 10372dfccc8cc1885247b8e4063974fbecbde6e54cbe394a5dfe84df9c2a1ceaa9c532fd882114b192adbf7d21e1717db5d7404081372fc90ec2df395afc539e
@@ -17,7 +17,6 @@ module Spree
17
17
 
18
18
  before_action :associate_user
19
19
  before_action :check_authorization
20
- before_action :apply_coupon_code, only: [:update]
21
20
 
22
21
  before_action :setup_for_current_state, only: [:edit, :update]
23
22
 
@@ -111,10 +110,6 @@ module Spree
111
110
  massaged_params = params.deep_dup
112
111
 
113
112
  move_payment_source_into_payments_attributes(massaged_params)
114
- if massaged_params[:order] && massaged_params[:order][:existing_card].present?
115
- Spree::Deprecation.warn("Passing order[:existing_card] is deprecated. Send order[:wallet_payment_source_id] instead.", caller)
116
- move_existing_card_into_payments_attributes(massaged_params) # deprecated
117
- end
118
113
  move_wallet_payment_source_id_into_payments_attributes(massaged_params)
119
114
  set_payment_parameters_amount(massaged_params, @order)
120
115
 
@@ -160,11 +155,6 @@ module Spree
160
155
  end
161
156
  end
162
157
 
163
- def set_state_if_present
164
- ensure_order_is_not_skipping_states
165
- end
166
- deprecate set_state_if_present: :prevent_order_from_skipping_states, deprecator: Spree::Deprecation
167
-
168
158
  def ensure_checkout_allowed
169
159
  unless @order.checkout_allowed?
170
160
  redirect_to spree.cart_path
@@ -188,24 +178,6 @@ module Spree
188
178
  spree.order_path(@order)
189
179
  end
190
180
 
191
- def apply_coupon_code
192
- if update_params[:coupon_code].present?
193
- Spree::Deprecation.warn('This endpoint is deprecated. Please use `Spree::CouponCodesController#create` endpoint instead.')
194
- @order.coupon_code = update_params[:coupon_code]
195
-
196
- handler = PromotionHandler::Coupon.new(@order).apply
197
-
198
- if handler.error.present?
199
- flash.now[:error] = handler.error
200
- elsif handler.success
201
- flash[:success] = handler.success
202
- end
203
-
204
- setup_for_current_state
205
- respond_with(@order) { |format| format.html { render :edit } } && return
206
- end
207
- end
208
-
209
181
  def setup_for_current_state
210
182
  method_name = :"before_#{@order.state}"
211
183
  send(method_name) if respond_to?(method_name, true)
@@ -239,14 +211,6 @@ module Spree
239
211
  @wallet_payment_sources = try_spree_current_user.wallet.wallet_payment_sources
240
212
  @default_wallet_payment_source = @wallet_payment_sources.detect(&:default) ||
241
213
  @wallet_payment_sources.first
242
-
243
- @payment_sources = Spree::DeprecatedInstanceVariableProxy.new(
244
- self,
245
- :deprecated_payment_sources,
246
- :@payment_sources,
247
- Spree::Deprecation,
248
- "Please, do not use @payment_sources anymore, use @wallet_payment_sources instead."
249
- )
250
214
  end
251
215
  end
252
216
 
@@ -276,22 +240,5 @@ module Spree
276
240
  end
277
241
  end
278
242
  end
279
-
280
- # This method returns payment sources of the current user. It is no more
281
- # used into our frontend. We used to assign the content of this method
282
- # into an ivar (@payment_sources) into the checkout payment step. This
283
- # method is here only to be able to deprecate this ivar and will be removed.
284
- #
285
- # DO NOT USE THIS METHOD!
286
- #
287
- # @return [Array<Spree::PaymentSource>] Payment sources connected to
288
- # current user wallet.
289
- # @deprecated This method has been added to deprecate @payment_sources
290
- # ivar and will be removed. Use @wallet_payment_sources instead.
291
- def deprecated_payment_sources
292
- try_spree_current_user.wallet.wallet_payment_sources
293
- .map(&:payment_source)
294
- .select { |ps| ps.is_a?(Spree::CreditCard) }
295
- end
296
243
  end
297
244
  end
@@ -10,7 +10,6 @@ module Spree
10
10
  before_action :assign_order, only: :update
11
11
  # note: do not lock the #edit action because that's where we redirect when we fail to acquire a lock
12
12
  around_action :lock_order, only: :update
13
- before_action :apply_coupon_code, only: :update
14
13
  skip_before_action :verify_authenticity_token, only: [:populate]
15
14
 
16
15
  def show
@@ -123,21 +122,5 @@ module Spree
123
122
  redirect_to(root_path) && return
124
123
  end
125
124
  end
126
-
127
- def apply_coupon_code
128
- if order_params[:coupon_code].present?
129
- Spree::Deprecation.warn('This endpoint is deprecated. Please use `Spree::CouponCodesController#create` endpoint instead.')
130
- @order.coupon_code = order_params[:coupon_code]
131
-
132
- handler = PromotionHandler::Coupon.new(@order).apply
133
-
134
- if handler.error.present?
135
- flash.now[:error] = handler.error
136
- respond_with(@order) { |format| format.html { render :edit } } && return
137
- elsif handler.success
138
- flash[:success] = handler.success
139
- end
140
- end
141
- end
142
125
  end
143
126
  end
@@ -1,21 +1,9 @@
1
1
  <% address_id = address_type.chars.first %>
2
2
  <div class="inner" data-hook=<%="#{address_type}_inner" %>>
3
- <% if Spree::Config.use_combined_first_and_last_name_in_address %>
4
- <div class="field field-required" id="<%= "#{address_id}name" %>">
5
- <%= form.label :name, t('spree.name') %>
6
- <%= form.text_field :name, class: 'required', autocomplete: address_type + ' name', required: true, autofocus: true %>
7
- </div>
8
- <% else %>
9
- <div class="field field-required" id="<%= "#{address_id}firstname" %>">
10
- <%= form.label :firstname, t('spree.first_name') %>
11
- <%= form.text_field :firstname, class: 'required', autocomplete: address_type + ' given-name', required: true, autofocus: true %>
12
- </div>
13
-
14
- <div class="field" id="<%= "#{address_id}lastname" %>">
15
- <%= form.label :lastname, t('spree.last_name') %>
16
- <%= form.text_field :lastname, autocomplete: address_type + ' family-name' %>
17
- </div>
18
- <% end %>
3
+ <div class="field field-required" id="<%= "#{address_id}name" %>">
4
+ <%= form.label :name, t('spree.name') %>
5
+ <%= form.text_field :name, class: 'required', autocomplete: address_type + ' name', required: true, autofocus: true %>
6
+ </div>
19
7
 
20
8
  <% if Spree::Config[:company] %>
21
9
  <div class="field" id=<%="#{address_id}company" %>>
@@ -1,9 +1,4 @@
1
- <% if Spree::Config.use_combined_first_and_last_name_in_address %>
2
- <%= form.hidden_field :name %>
3
- <% else %>
4
- <%= form.hidden_field :firstname %>
5
- <%= form.hidden_field :lastname %>
6
- <% end %>
1
+ <%= form.hidden_field :name %>
7
2
  <%= form.hidden_field :company %>
8
3
  <%= form.hidden_field :address1 %>
9
4
  <%= form.hidden_field :address2 %>
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/all'
3
+ require 'solidus_core'
4
+ require 'solidus_api'
5
+
4
6
  require 'jquery-rails'
5
7
  require 'canonical-rails'
6
8
  require 'sassc-rails'
@@ -8,8 +10,5 @@ require 'font-awesome-rails'
8
10
  require 'responders'
9
11
  require 'kaminari'
10
12
 
11
- require 'solidus_core'
12
- require 'solidus_api'
13
-
14
13
  require 'spree/frontend/middleware/seo_assist'
15
14
  require 'spree/frontend/engine'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.7
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-18 00:00:00.000000000 Z
11
+ date: 2021-05-10 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: 2.11.7
19
+ version: 3.0.1
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: 2.11.7
26
+ version: 3.0.1
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: 2.11.7
33
+ version: 3.0.1
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: 2.11.7
40
+ version: 3.0.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement