solidus_core 4.7.0 → 4.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/spree/products_helper.rb +1 -1
- data/app/models/concerns/spree/user_methods.rb +4 -4
- data/app/models/spree/in_memory_order_updater.rb +2 -4
- data/app/models/spree/line_item.rb +1 -1
- data/app/models/spree/order_updater.rb +1 -1
- data/app/models/spree/payment/processing.rb +0 -1
- data/app/models/spree/payment_create.rb +23 -0
- data/app/models/spree/permission_sets/default_customer.rb +3 -3
- data/app/models/spree/product.rb +9 -6
- data/app/models/spree/return_item.rb +9 -0
- data/app/models/spree/shipment.rb +7 -2
- data/app/models/spree/shipping_manifest.rb +44 -9
- data/app/models/spree/stock/estimator.rb +1 -1
- data/app/models/spree/store.rb +1 -1
- data/app/models/spree/taxon.rb +5 -2
- data/app/models/spree/variant/pricing_options.rb +1 -1
- data/app/models/spree/variant/vat_price_generator.rb +1 -0
- data/app/views/layouts/spree/base_mailer.html.erb +1 -0
- data/app/views/layouts/spree/ink.license.txt +28 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/permitted_attributes.rb +2 -1
- data/lib/spree/preferences/statically_configurable.rb +2 -1
- data/lib/spree/testing_support/capybara_ext.rb +9 -1
- data/lib/spree/testing_support/dummy_app.rb +16 -1
- data/lib/spree/testing_support/factories/return_item_factory.rb +9 -1
- data/vendor/assets/javascripts/jquery.payment.license.txt +25 -0
- data/vendor/assets/javascripts/jsuri.license.txt +12 -0
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d3d8242467851026fff5d6e6c31639174974d747193e9bef00a77acbd7c6e912
|
|
4
|
+
data.tar.gz: 7336f44aad6dc32d2d477acffe0de1af5acb1df5fa7bd399b3b754e3647269e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0521407fa49fac2011d849d4fa08f03a165c32751ffdda07656dd985c3aa73a3ea0b90e4d7b6dfc7157a310fc371d3195b9e7e3f1d1b1b517d3c927370d01c8
|
|
7
|
+
data.tar.gz: 4619fdf8d485b61ba1610d4c579fd83f82e4f0710648719b07c4ec4e246915a6d2de458f351560c375b212c84a37db01d9b9463608f1f141e27e531e363a958f
|
|
@@ -130,14 +130,14 @@ module Spree
|
|
|
130
130
|
|
|
131
131
|
# Updates the roles in keeping with the given ability's permissions
|
|
132
132
|
#
|
|
133
|
-
# Roles that
|
|
134
|
-
#
|
|
135
|
-
#
|
|
133
|
+
# Roles that the given ability cannot manage will be ignored. It also
|
|
134
|
+
# ensure not to remove non manageable roles when assigning new manageable
|
|
135
|
+
# ones.
|
|
136
136
|
#
|
|
137
137
|
# @param given_roles [Spree::Role]
|
|
138
138
|
# @param ability [Spree::Ability]
|
|
139
139
|
def update_spree_roles(given_roles, ability:)
|
|
140
|
-
accessible_roles = Spree::Role.accessible_by(ability)
|
|
140
|
+
accessible_roles = Spree::Role.accessible_by(ability, :manage)
|
|
141
141
|
non_accessible_roles = Spree::Role.all - accessible_roles
|
|
142
142
|
new_accessible_roles = given_roles - non_accessible_roles
|
|
143
143
|
self.spree_roles = spree_roles - accessible_roles + new_accessible_roles
|
|
@@ -53,10 +53,10 @@ module Spree
|
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
Spree::Bus.publish(:order_recalculated, order:)
|
|
57
|
-
|
|
58
56
|
persist_totals if persist
|
|
59
57
|
end
|
|
58
|
+
|
|
59
|
+
Spree::Bus.publish(:order_recalculated, order:) if persist
|
|
60
60
|
end
|
|
61
61
|
alias_method :update, :recalculate
|
|
62
62
|
deprecate update: :recalculate, deprecator: Spree.deprecator
|
|
@@ -236,8 +236,6 @@ module Spree
|
|
|
236
236
|
end
|
|
237
237
|
|
|
238
238
|
def persist_totals
|
|
239
|
-
shipments.each(&:persist_amounts)
|
|
240
|
-
assign_item_totals
|
|
241
239
|
log_state_change("payment")
|
|
242
240
|
log_state_change("shipment")
|
|
243
241
|
order.save!
|
|
@@ -62,7 +62,7 @@ module Spree
|
|
|
62
62
|
# @return [BigDecimal] the amount of this item, taking into consideration
|
|
63
63
|
# all non-tax adjustments.
|
|
64
64
|
def total_before_tax
|
|
65
|
-
amount + adjustments.reject
|
|
65
|
+
amount + adjustments.reject { |adjustment| adjustment.tax? || adjustment.marked_for_destruction? }.sum(&:amount)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
# @return [BigDecimal] the amount of this line item before VAT tax
|
|
@@ -27,9 +27,9 @@ module Spree
|
|
|
27
27
|
update_shipments
|
|
28
28
|
recalculate_shipment_state
|
|
29
29
|
end
|
|
30
|
-
Spree::Bus.publish(:order_recalculated, order:)
|
|
31
30
|
persist_totals
|
|
32
31
|
end
|
|
32
|
+
Spree::Bus.publish(:order_recalculated, order:)
|
|
33
33
|
end
|
|
34
34
|
alias_method :update, :recalculate
|
|
35
35
|
deprecate update: :recalculate, deprecator: Spree.deprecator
|
|
@@ -8,6 +8,10 @@ module Spree
|
|
|
8
8
|
# * :payment_method_id Id of payment method used for this payment
|
|
9
9
|
# * :source_attributes Attributes used to build the source of this payment. Usually a {CreditCard}
|
|
10
10
|
# * :wallet_payment_source_id (Integer): The id of a {WalletPaymentSource} to use
|
|
11
|
+
# * :gateway_customer_profile_id, :gateway_payment_profile_id (String): Gateway
|
|
12
|
+
# identifiers for a new {CreditCard}, e.g. a one-time token. Raises
|
|
13
|
+
# ActiveRecord::RecordNotFound if either already belongs to a {CreditCard}
|
|
14
|
+
# owned by a different user.
|
|
11
15
|
# @param request_env [Hash] rack env of user creating the payment
|
|
12
16
|
# @param payment [Payment] Internal use only. Instead of making a new payment, change the attributes for an existing one.
|
|
13
17
|
def initialize(order, attributes, payment: nil, request_env: {})
|
|
@@ -44,6 +48,7 @@ module Spree
|
|
|
44
48
|
def build_source
|
|
45
49
|
payment_method = payment.payment_method
|
|
46
50
|
if source_attributes.present? && payment_method.try(:payment_source_class)
|
|
51
|
+
ensure_gateway_profile_ownership!(payment_method.payment_source_class)
|
|
47
52
|
payment.source = payment_method.payment_source_class.new(source_attributes)
|
|
48
53
|
payment.source.payment_method_id = payment_method.id
|
|
49
54
|
if order && payment.source.respond_to?(:user=)
|
|
@@ -52,6 +57,24 @@ module Spree
|
|
|
52
57
|
end
|
|
53
58
|
end
|
|
54
59
|
|
|
60
|
+
# Gateway profile ids may only be submitted for a new source when they are
|
|
61
|
+
# unknown to the store (e.g. a one-time token) or already belong to the
|
|
62
|
+
# order's user. Raises if either id is stored on a {CreditCard} owned by a
|
|
63
|
+
# different user, so customers cannot pay with another customer's stored
|
|
64
|
+
# gateway credential.
|
|
65
|
+
def ensure_gateway_profile_ownership!(source_class)
|
|
66
|
+
return unless source_class <= Spree::CreditCard
|
|
67
|
+
|
|
68
|
+
%i[gateway_customer_profile_id gateway_payment_profile_id].each do |attribute|
|
|
69
|
+
value = source_attributes[attribute]
|
|
70
|
+
next if value.blank?
|
|
71
|
+
|
|
72
|
+
foreign_cards = Spree::CreditCard.where(attribute => value).where.not(user_id: nil)
|
|
73
|
+
foreign_cards = foreign_cards.where.not(user_id: order.user_id) if order&.user_id
|
|
74
|
+
raise ActiveRecord::RecordNotFound if foreign_cards.exists?
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
55
78
|
def build_from_wallet_payment_source
|
|
56
79
|
wallet_payment_source_id = source_attributes.fetch(:wallet_payment_source_id)
|
|
57
80
|
raise(ActiveRecord::RecordNotFound) if order.user.nil?
|
|
@@ -63,18 +63,18 @@ module Spree
|
|
|
63
63
|
can :create, ReturnAuthorization do |return_authorization|
|
|
64
64
|
return_authorization.order.user == user
|
|
65
65
|
end
|
|
66
|
-
can [:read, :update], CreditCard, user_id: user.id
|
|
66
|
+
can [:read, :update], CreditCard, user_id: user.id if user.persisted?
|
|
67
67
|
can :read, Product
|
|
68
68
|
can :read, ProductProperty
|
|
69
69
|
can :read, Property
|
|
70
70
|
can :create, Spree.user_class
|
|
71
|
-
can [:show, :update, :update_email], Spree.user_class, id: user.id
|
|
71
|
+
can [:show, :update, :update_email], Spree.user_class, id: user.id if user.persisted?
|
|
72
72
|
can :read, State
|
|
73
73
|
can :read, StockItem, stock_location: {active: true}
|
|
74
74
|
can :read, StockLocation, active: true
|
|
75
75
|
can :read, Taxon
|
|
76
76
|
can :read, Taxonomy
|
|
77
|
-
can [:save_in_address_book, :remove_from_address_book], Spree.user_class, id: user.id
|
|
77
|
+
can [:save_in_address_book, :remove_from_address_book], Spree.user_class, id: user.id if user.persisted?
|
|
78
78
|
can [:read, :view_out_of_stock], Variant
|
|
79
79
|
can :read, Zone
|
|
80
80
|
end
|
data/app/models/spree/product.rb
CHANGED
|
@@ -355,14 +355,17 @@ module Spree
|
|
|
355
355
|
run_callbacks(:touch)
|
|
356
356
|
end
|
|
357
357
|
|
|
358
|
-
# Iterate through this product's taxons and taxonomies and touch their timestamps
|
|
358
|
+
# Iterate through this product's taxons and taxonomies and touch their timestamps
|
|
359
359
|
def touch_taxons
|
|
360
|
-
taxons_to_touch = taxons.flat_map(&:self_and_ancestors).uniq
|
|
361
|
-
|
|
362
|
-
Spree::Taxon.where(id: taxons_to_touch.map(&:id)).update_all(updated_at: Time.current)
|
|
360
|
+
taxons_to_touch = taxons.flat_map(&:self_and_ancestors).uniq.sort_by(&:id)
|
|
361
|
+
return if taxons_to_touch.empty?
|
|
363
362
|
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
time = Time.current
|
|
364
|
+
taxons_to_touch.each { |taxon| taxon.update_column(:updated_at, time) }
|
|
365
|
+
|
|
366
|
+
taxonomy_ids_to_touch = taxons_to_touch.map(&:taxonomy_id).uniq
|
|
367
|
+
Spree::Taxonomy.where(id: taxonomy_ids_to_touch).order(:id).each do |taxonomy|
|
|
368
|
+
taxonomy.touch(time:)
|
|
366
369
|
end
|
|
367
370
|
end
|
|
368
371
|
|
|
@@ -41,6 +41,7 @@ module Spree
|
|
|
41
41
|
|
|
42
42
|
validate :eligible_exchange_variant
|
|
43
43
|
validate :belongs_to_same_customer_order
|
|
44
|
+
validate :belongs_to_return_authorization_order, if: -> { inventory_unit_id_changed? || return_authorization_id_changed? }
|
|
44
45
|
validate :validate_acceptance_status_for_reimbursement
|
|
45
46
|
validate :validate_no_other_completed_return_items
|
|
46
47
|
|
|
@@ -226,6 +227,14 @@ module Spree
|
|
|
226
227
|
end
|
|
227
228
|
end
|
|
228
229
|
|
|
230
|
+
def belongs_to_return_authorization_order
|
|
231
|
+
return unless return_authorization && inventory_unit
|
|
232
|
+
|
|
233
|
+
if return_authorization.order_id != inventory_unit.order_id
|
|
234
|
+
errors.add(:base, I18n.t("spree.return_items_cannot_be_associated_with_multiple_orders"))
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
|
|
229
238
|
def eligible_exchange_variant
|
|
230
239
|
return unless exchange_variant && exchange_variant_id_changed?
|
|
231
240
|
unless eligible_exchange_variants.include?(exchange_variant)
|
|
@@ -95,7 +95,7 @@ module Spree
|
|
|
95
95
|
# @return [BigDecimal] the amount of this item, taking into consideration
|
|
96
96
|
# all non-tax adjustments.
|
|
97
97
|
def total_before_tax
|
|
98
|
-
amount + adjustments.reject
|
|
98
|
+
amount + adjustments.reject { |adjustment| adjustment.tax? || adjustment.marked_for_destruction? }.sum(&:amount)
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
# @return [BigDecimal] the amount of this shipment before VAT tax
|
|
@@ -178,7 +178,12 @@ module Spree
|
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
def manifest
|
|
181
|
-
@manifest ||= Spree::ShippingManifest.new(
|
|
181
|
+
@manifest ||= Spree::ShippingManifest.new(
|
|
182
|
+
inventory_units:,
|
|
183
|
+
# Only when it is already in memory — the manifest treats the order as an
|
|
184
|
+
# optimization and must not cause a query for it.
|
|
185
|
+
order: (order if association(:order).loaded?)
|
|
186
|
+
).items
|
|
182
187
|
end
|
|
183
188
|
|
|
184
189
|
def selected_shipping_rate_id
|
|
@@ -3,28 +3,63 @@
|
|
|
3
3
|
class Spree::ShippingManifest
|
|
4
4
|
ManifestItem = Struct.new(:line_item, :variant, :quantity, :states)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
attr_reader :inventory_units, :order
|
|
7
|
+
|
|
8
|
+
# @param inventory_units [Enumerable<Spree::InventoryUnit>]
|
|
9
|
+
# @param order [Spree::Order, nil] the order the units belong to. When
|
|
10
|
+
# given and its line items are already loaded, the manifest reuses those
|
|
11
|
+
# +Spree::LineItem+ instances rather than letting each inventory unit
|
|
12
|
+
# load its own copy.
|
|
13
|
+
def initialize(inventory_units:, order: nil)
|
|
14
|
+
@inventory_units = inventory_units
|
|
15
|
+
@order = order
|
|
8
16
|
end
|
|
9
17
|
|
|
10
18
|
def for_order(order)
|
|
11
|
-
|
|
12
|
-
inventory_units:
|
|
19
|
+
self.class.new(
|
|
20
|
+
inventory_units: inventory_units.select { |unit| unit.order_id == order.id },
|
|
21
|
+
order: order
|
|
13
22
|
)
|
|
14
23
|
end
|
|
15
24
|
|
|
16
25
|
def items
|
|
17
26
|
# Grouping by the ID means that we don't have to call out to the association accessor
|
|
18
27
|
# This makes the grouping by faster because it results in less SQL cache hits.
|
|
19
|
-
|
|
20
|
-
variant_units.group_by(&:line_item_id).map do |
|
|
28
|
+
inventory_units.group_by(&:variant_id).flat_map do |_variant_id, variant_units|
|
|
29
|
+
variant_units.group_by(&:line_item_id).map do |line_item_id, line_item_units|
|
|
21
30
|
states = {}
|
|
22
|
-
|
|
31
|
+
line_item_units.group_by(&:state).each { |state, iu| states[state] = iu.count }
|
|
23
32
|
|
|
24
|
-
first_unit =
|
|
33
|
+
first_unit = line_item_units.first
|
|
25
34
|
|
|
26
|
-
ManifestItem.new(
|
|
35
|
+
ManifestItem.new(
|
|
36
|
+
line_item_for(line_item_id, first_unit),
|
|
37
|
+
first_unit.variant,
|
|
38
|
+
line_item_units.length,
|
|
39
|
+
states
|
|
40
|
+
)
|
|
27
41
|
end
|
|
28
42
|
end
|
|
29
43
|
end
|
|
44
|
+
|
|
45
|
+
private
|
|
46
|
+
|
|
47
|
+
# Prefer the instance the order already holds in memory. Rails has no identity
|
|
48
|
+
# map, so +unit.line_item+ returns a second instance of the same row: it does
|
|
49
|
+
# not reflect adjustments that have been recalculated on the order's own line
|
|
50
|
+
# items but not yet persisted, and it costs a query per line item on top.
|
|
51
|
+
def line_item_for(line_item_id, unit)
|
|
52
|
+
order_line_items.fetch(line_item_id) { unit.line_item }
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Empty unless the order's line items are already loaded. This is an
|
|
56
|
+
# optimization for callers that have them, never a reason to run a query.
|
|
57
|
+
def order_line_items
|
|
58
|
+
@order_line_items ||=
|
|
59
|
+
if order&.association(:line_items)&.loaded?
|
|
60
|
+
order.line_items.index_by(&:id)
|
|
61
|
+
else
|
|
62
|
+
{}
|
|
63
|
+
end
|
|
64
|
+
end
|
|
30
65
|
end
|
data/app/models/spree/store.rb
CHANGED
data/app/models/spree/taxon.rb
CHANGED
|
@@ -140,8 +140,11 @@ module Spree
|
|
|
140
140
|
private
|
|
141
141
|
|
|
142
142
|
def touch_ancestors_and_taxonomy
|
|
143
|
-
# Touches
|
|
144
|
-
|
|
143
|
+
# Touches ancestors directly rather than through #touch to avoid a recursive taxonomy touch.
|
|
144
|
+
time = Time.current
|
|
145
|
+
self.class.default_scoped.where(id: ancestors.pluck(:id)).order(:id).each do |ancestor|
|
|
146
|
+
ancestor.update_column(:updated_at, time)
|
|
147
|
+
end
|
|
145
148
|
# Have taxonomy touch happen in #touch_ancestors_and_taxonomy rather than association option in order for imports to override.
|
|
146
149
|
taxonomy.try!(:touch)
|
|
147
150
|
end
|
|
@@ -25,6 +25,7 @@ module Spree
|
|
|
25
25
|
def run
|
|
26
26
|
# Early return if there is no VAT rates in the current store.
|
|
27
27
|
return if !variant.tax_category || variant_vat_rates.empty?
|
|
28
|
+
return if variant.default_price&.amount.nil?
|
|
28
29
|
|
|
29
30
|
country_isos_requiring_price.each do |country_iso|
|
|
30
31
|
# Don't re-create the default price
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width">
|
|
6
|
+
<%# The Ink CSS below is MIT licensed; see ink.license.txt in this directory. %>
|
|
6
7
|
<style>
|
|
7
8
|
/**********************************************
|
|
8
9
|
* Ink v1.0.5 - Copyright 2013 ZURB Inc *
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
The mailer layout in this directory (base_mailer.html.erb) inlines the
|
|
2
|
+
CSS of Ink v1.0.5, ZURB's responsive email framework, from
|
|
3
|
+
https://github.com/foundation/foundation-emails (formerly zurb/ink).
|
|
4
|
+
|
|
5
|
+
--------------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2013 ZURB, inc.
|
|
8
|
+
|
|
9
|
+
MIT License
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
12
|
+
a copy of this software and associated documentation files (the
|
|
13
|
+
"Software"), to deal in the Software without restriction, including
|
|
14
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
15
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
16
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
17
|
+
the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be
|
|
20
|
+
included in all copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
23
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
24
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
25
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
26
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
27
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
28
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/spree/core/version.rb
CHANGED
|
@@ -73,7 +73,7 @@ module Spree
|
|
|
73
73
|
|
|
74
74
|
@@option_type_attributes = [:name, :presentation, option_values_attributes: option_value_attributes]
|
|
75
75
|
|
|
76
|
-
@@payment_attributes = [:
|
|
76
|
+
@@payment_attributes = [:payment_method_id, :payment_method, customer_metadata: {}]
|
|
77
77
|
|
|
78
78
|
@@product_properties_attributes = [:property_name, :value, :position]
|
|
79
79
|
|
|
@@ -165,6 +165,7 @@ module Spree
|
|
|
165
165
|
|
|
166
166
|
@@checkout_payment_attributes = [
|
|
167
167
|
payments_attributes: payment_attributes + [
|
|
168
|
+
:amount,
|
|
168
169
|
source_attributes:
|
|
169
170
|
]
|
|
170
171
|
]
|
|
@@ -22,7 +22,8 @@ module Spree
|
|
|
22
22
|
|
|
23
23
|
def preferences
|
|
24
24
|
if respond_to?(:preference_source) && preference_source
|
|
25
|
-
self.class.preference_sources[preference_source]
|
|
25
|
+
source = self.class.preference_sources[preference_source]
|
|
26
|
+
source ? default_preferences.merge(source.to_hash) : {}
|
|
26
27
|
else
|
|
27
28
|
self[:preferences]
|
|
28
29
|
end
|
|
@@ -4,7 +4,15 @@ module Spree
|
|
|
4
4
|
module TestingSupport
|
|
5
5
|
module CapybaraExt
|
|
6
6
|
def click_icon(type)
|
|
7
|
-
find(".fa-#{type}")
|
|
7
|
+
el = find(".fa-#{type}", visible: :all)
|
|
8
|
+
begin
|
|
9
|
+
el.click
|
|
10
|
+
rescue Selenium::WebDriver::Error::ElementClickInterceptedError
|
|
11
|
+
# When a floating element (eg. tooltips/overlays) intercepts the click,
|
|
12
|
+
# scroll the target into view and dispatch a click via JS to keep tests stable.
|
|
13
|
+
page.execute_script('arguments[0].scrollIntoView({block: "center"});', el.native)
|
|
14
|
+
page.execute_script("arguments[0].click();", el.native)
|
|
15
|
+
end
|
|
8
16
|
end
|
|
9
17
|
|
|
10
18
|
def eventually_fill_in(field, options = {})
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
ENV["RAILS_ENV"] = "test"
|
|
4
4
|
ENV["DISABLE_DATABASE_ENVIRONMENT_CHECK"] = "1"
|
|
5
5
|
|
|
6
|
+
# Speed up the sqlite runs: `fast_sqlite` patches SQLite3::Database#initialize to
|
|
7
|
+
# set `PRAGMA synchronous = OFF` and `journal_mode = MEMORY`, trading durability we
|
|
8
|
+
# don't need for a database the suite recreates anyway.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: The gem is declared `require: false`, and only when DB is sqlite, so it is
|
|
11
|
+
# genuinely absent for the mysql and postgres runs.
|
|
12
|
+
begin
|
|
13
|
+
require "fast_sqlite"
|
|
14
|
+
rescue LoadError
|
|
15
|
+
# Not running against sqlite, nothing to speed up.
|
|
16
|
+
end
|
|
17
|
+
|
|
6
18
|
require "rails"
|
|
7
19
|
require "active_record/railtie"
|
|
8
20
|
require "action_controller/railtie"
|
|
@@ -106,7 +118,10 @@ module DummyApp
|
|
|
106
118
|
|
|
107
119
|
# Set the preview path within the dummy app:
|
|
108
120
|
if ActionMailer::Base.respond_to? :preview_paths # Rails 7.1+
|
|
109
|
-
|
|
121
|
+
# Some Rails versions return a frozen array here; assign a new array
|
|
122
|
+
# to avoid FrozenError when augmenting the paths.
|
|
123
|
+
existing = Array(config.action_mailer.preview_paths)
|
|
124
|
+
config.action_mailer.preview_paths = existing + [File.expand_path("dummy_app/mailer_previews", __dir__)]
|
|
110
125
|
else
|
|
111
126
|
config.action_mailer.preview_path = File.expand_path("dummy_app/mailer_previews", __dir__)
|
|
112
127
|
end
|
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
FactoryBot.define do
|
|
4
4
|
factory :return_item, class: "Spree::ReturnItem" do
|
|
5
|
-
|
|
5
|
+
inventory_unit do
|
|
6
|
+
# When a return authorization is given, the inventory unit must belong
|
|
7
|
+
# to the same order.
|
|
8
|
+
if __override_names__.include?(:return_authorization) && return_authorization&.order
|
|
9
|
+
association(:inventory_unit, state: :shipped, order: return_authorization.order)
|
|
10
|
+
else
|
|
11
|
+
association(:inventory_unit, state: :shipped)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
6
14
|
association(:return_reason, factory: :return_reason)
|
|
7
15
|
return_authorization do |_return_item|
|
|
8
16
|
build(:return_authorization, order: inventory_unit.order)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
This license covers the vendored jQuery.payment v1.3.2 (jquery.payment.js
|
|
2
|
+
in this directory), from https://github.com/stripe-archive/jquery.payment.
|
|
3
|
+
|
|
4
|
+
--------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2014 Stripe
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
9
|
+
a copy of this software and associated documentation files (the
|
|
10
|
+
"Software"), to deal in the Software without restriction, including
|
|
11
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
12
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
14
|
+
the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be
|
|
17
|
+
included in all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
20
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
21
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
23
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
24
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
25
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
This license covers the vendored jsUri v1.1.1 (jsuri.js in this
|
|
2
|
+
directory), from https://github.com/derek-watson/jsUri.
|
|
3
|
+
|
|
4
|
+
--------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2014, Derek Watson
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidus_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.7.
|
|
4
|
+
version: 4.7.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Solidus Team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: actionmailer
|
|
@@ -771,6 +770,7 @@ files:
|
|
|
771
770
|
- app/subscribers/spree/order_mailer_subscriber.rb
|
|
772
771
|
- app/subscribers/spree/reimbursement_mailer_subscriber.rb
|
|
773
772
|
- app/views/layouts/spree/base_mailer.html.erb
|
|
773
|
+
- app/views/layouts/spree/ink.license.txt
|
|
774
774
|
- app/views/spree/carton_mailer/shipped_email.html.erb
|
|
775
775
|
- app/views/spree/carton_mailer/shipped_email.text.erb
|
|
776
776
|
- app/views/spree/order_mailer/cancel_email.html.erb
|
|
@@ -1075,7 +1075,9 @@ files:
|
|
|
1075
1075
|
- lib/tasks/solidus/delete_prices_with_nil_amount.rake
|
|
1076
1076
|
- solidus_core.gemspec
|
|
1077
1077
|
- vendor/assets/javascripts/jquery.payment.js
|
|
1078
|
+
- vendor/assets/javascripts/jquery.payment.license.txt
|
|
1078
1079
|
- vendor/assets/javascripts/jsuri.js
|
|
1080
|
+
- vendor/assets/javascripts/jsuri.license.txt
|
|
1079
1081
|
- vendor/assets/stylesheets/normalize.css
|
|
1080
1082
|
homepage: http://solidus.io
|
|
1081
1083
|
licenses:
|
|
@@ -1119,8 +1121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1119
1121
|
- !ruby/object:Gem::Version
|
|
1120
1122
|
version: 1.8.23
|
|
1121
1123
|
requirements: []
|
|
1122
|
-
rubygems_version:
|
|
1123
|
-
signing_key:
|
|
1124
|
+
rubygems_version: 4.0.10
|
|
1124
1125
|
specification_version: 4
|
|
1125
1126
|
summary: Essential models, mailers, and classes for the Solidus e-commerce project.
|
|
1126
1127
|
test_files: []
|