solidus_frontend 2.11.11 → 3.0.0.rc2

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: 9853d135e8589a6c192d8688761befa8598af87f7d5b664a6d8a4bb5f6b54b3d
4
- data.tar.gz: b0e513914f9165c45aacbd09601d8521da3c19226e0e17b08875174ccf8c3b40
3
+ metadata.gz: 2f19e01d0dcb84ddcefa852bdaf556965d5a27f5b2b7884f4c435d5fb5e714b6
4
+ data.tar.gz: f4d3b81886e51d9c1c5567af09579b22e38ea018aed025eb70d7d01575953d5c
5
5
  SHA512:
6
- metadata.gz: 781d23184ca4044cce4475b2d1646941cf60e55cfe5eb556cfc3cdcb1b55277572a6e99aaa252fe737f11e37caeb13bd09665fdee3d449c54dba6fe758f24e3a
7
- data.tar.gz: 6d45bffe650fac2d88e40840c24bd87e673f529c6fcc5d36372cf4cf5b118719c0c4f355623ef28902e793e3fdca4757ddf050eb8d4be4a704c0bc81f3a4cdf2
6
+ metadata.gz: 4de5d0c59250804c0fb05332c3850e16ad606ffb65d94def29de868917eff33eae33518ee9efed68569cfc23686e3dfc766320e6e7806f63aa60afb14bdb548f
7
+ data.tar.gz: 0db810a9dc4bd5aa3f04c70480ed1fda41da275d27d3d338ea95659dd99fa45c5ebf5ca2bf779b3a567f3363044e2027d03ab7f34df259a584fdb251758e33e9
@@ -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.11
4
+ version: 3.0.0.rc2
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-09-10 00:00:00.000000000 Z
11
+ date: 2021-03-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.11
19
+ version: 3.0.0.rc2
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.11
26
+ version: 3.0.0.rc2
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.11
33
+ version: 3.0.0.rc2
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.11
40
+ version: 3.0.0.rc2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -304,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
304
  - !ruby/object:Gem::Version
305
305
  version: 1.8.23
306
306
  requirements: []
307
- rubygems_version: 3.2.20
307
+ rubygems_version: 3.1.4
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: Cart and storefront for the Solidus e-commerce project.