spree_core 5.0.2 → 5.1.0.beta

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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/logo.png +0 -0
  3. data/app/finders/spree/products/find.rb +28 -1
  4. data/app/finders/spree/taxons/find.rb +1 -1
  5. data/app/helpers/spree/integrations_helper.rb +15 -0
  6. data/app/javascript/spree/core/controllers/disable_submit_button_controller.js +19 -0
  7. data/app/mailers/spree/invitation_mailer.rb +24 -0
  8. data/app/models/concerns/spree/integrations_concern.rb +11 -0
  9. data/app/models/concerns/spree/product_scopes.rb +6 -6
  10. data/app/models/concerns/spree/translatable_resource.rb +4 -0
  11. data/app/models/concerns/spree/translatable_resource_scopes.rb +17 -3
  12. data/app/models/concerns/spree/unique_name.rb +2 -0
  13. data/app/models/concerns/spree/user_management.rb +33 -0
  14. data/app/models/concerns/spree/user_methods.rb +19 -0
  15. data/app/models/concerns/spree/user_roles.rb +43 -17
  16. data/app/models/spree/ability.rb +8 -6
  17. data/app/models/spree/asset.rb +1 -6
  18. data/app/models/spree/base.rb +1 -0
  19. data/app/models/spree/base_analytics_event_handler.rb +7 -2
  20. data/app/models/spree/classification.rb +13 -0
  21. data/app/models/spree/custom_domain.rb +2 -1
  22. data/app/models/spree/export.rb +1 -1
  23. data/app/models/spree/integration.rb +63 -0
  24. data/app/models/spree/invitation.rb +153 -0
  25. data/app/models/spree/invitations/store.rb +6 -0
  26. data/app/models/spree/order.rb +17 -1
  27. data/app/models/spree/order_merger.rb +7 -5
  28. data/app/models/spree/page_blocks/products/buy_buttons.rb +8 -0
  29. data/app/models/spree/page_blocks/products/quantity_selector.rb +4 -0
  30. data/app/models/spree/page_blocks/products/variant_picker.rb +4 -0
  31. data/app/models/spree/page_sections/featured_product.rb +4 -0
  32. data/app/models/spree/page_sections/image_banner.rb +12 -0
  33. data/app/models/spree/page_sections/image_with_text.rb +12 -0
  34. data/app/models/spree/page_sections/newsletter.rb +1 -1
  35. data/app/models/spree/page_sections/rich_text.rb +11 -0
  36. data/app/models/spree/page_sections/video.rb +8 -0
  37. data/app/models/spree/product.rb +10 -2
  38. data/app/models/spree/product_property.rb +1 -1
  39. data/app/models/spree/property.rb +3 -1
  40. data/app/models/spree/reports/sales_total.rb +5 -1
  41. data/app/models/spree/role.rb +16 -0
  42. data/app/models/spree/role_user.rb +32 -1
  43. data/app/models/spree/shipment.rb +1 -1
  44. data/app/models/spree/shipment_handler.rb +1 -0
  45. data/app/models/spree/shipping_method.rb +1 -1
  46. data/app/models/spree/store.rb +12 -5
  47. data/app/models/spree/store_credit_category.rb +4 -0
  48. data/app/models/spree/taxon.rb +4 -3
  49. data/app/models/spree/theme.rb +37 -4
  50. data/app/models/spree/variant.rb +9 -1
  51. data/app/services/spree/country_to_timezone.rb +273 -0
  52. data/app/services/spree/seeds/admin_user.rb +4 -2
  53. data/app/services/spree/seeds/all.rb +3 -1
  54. data/app/services/spree/seeds/digital_delivery.rb +20 -0
  55. data/app/services/spree/seeds/returns_environment.rb +27 -0
  56. data/app/services/spree/seeds/tax_categories.rb +12 -0
  57. data/app/services/spree/stores/settings_defaults_by_country.rb +38 -0
  58. data/app/services/spree/tags/bulk_add.rb +13 -7
  59. data/app/views/spree/invitation_mailer/invitation_accepted.html.erb +12 -0
  60. data/app/views/spree/invitation_mailer/invitation_email.html.erb +21 -0
  61. data/config/locales/en.yml +48 -10
  62. data/db/migrate/20230110142344_backfill_friendly_id_slug_locale.rb +3 -1
  63. data/db/migrate/20250407085228_create_spree_integrations.rb +12 -0
  64. data/db/migrate/20250410061306_create_spree_invitations.rb +20 -0
  65. data/db/migrate/20250418174652_add_resource_to_spree_role_users.rb +8 -0
  66. data/db/migrate/20250508060800_add_selected_locale_to_spree_admin_users.rb +8 -0
  67. data/db/migrate/20250509143831_add_session_id_to_spree_assets.rb +5 -0
  68. data/lib/generators/spree/authentication/devise/devise_generator.rb +5 -2
  69. data/lib/generators/spree/authentication/devise/templates/authentication_helpers.rb.tt +3 -3
  70. data/lib/generators/spree/install/install_generator.rb +5 -0
  71. data/lib/spree/core/controller_helpers/auth.rb +16 -14
  72. data/lib/spree/core/controller_helpers/currency.rb +11 -0
  73. data/lib/spree/core/controller_helpers/order.rb +2 -1
  74. data/lib/spree/core/controller_helpers/strong_parameters.rb +3 -2
  75. data/lib/spree/core/engine.rb +12 -8
  76. data/lib/spree/core/version.rb +1 -1
  77. data/lib/spree/core.rb +1 -0
  78. data/lib/spree/permitted_attributes.rb +118 -13
  79. data/lib/spree/testing_support/capybara_config.rb +1 -1
  80. data/lib/spree/testing_support/factories/integration_factory.rb +7 -0
  81. data/lib/spree/testing_support/factories/invitation_factory.rb +6 -0
  82. data/lib/spree/testing_support/factories/promotion_action_factory.rb +4 -0
  83. data/lib/spree/testing_support/factories/stock_item_factory.rb +5 -1
  84. data/lib/spree/testing_support/factories/user_factory.rb +14 -1
  85. data/lib/spree/translation_migrations.rb +27 -15
  86. data/lib/tasks/core.rake +8 -0
  87. metadata +41 -4
@@ -2,38 +2,65 @@ module Spree
2
2
  module PermittedAttributes
3
3
  ATTRIBUTES = [
4
4
  :address_attributes,
5
+ :asset_attributes,
5
6
  :checkout_attributes,
6
7
  :classification_attributes,
7
8
  :cms_page_attributes,
8
9
  :cms_section_attributes,
10
+ :custom_domain_attributes,
9
11
  :customer_return_attributes,
10
12
  :digital_attributes,
11
13
  :digital_link_attributes,
14
+ :export_attributes,
12
15
  :image_attributes,
16
+ :integration_attributes,
13
17
  :inventory_unit_attributes,
18
+ :invitation_attributes,
14
19
  :line_item_attributes,
15
20
  :menu_attributes,
16
21
  :menu_item_attributes,
17
22
  :option_type_attributes,
18
23
  :option_value_attributes,
24
+ :page_attributes,
25
+ :page_link_attributes,
26
+ :page_section_attributes,
19
27
  :payment_attributes,
28
+ :payment_method_attributes,
20
29
  :product_attributes,
30
+ :promotion_attributes,
31
+ :promotion_rule_attributes,
32
+ :promotion_action_attributes,
21
33
  :product_properties_attributes,
22
34
  :property_attributes,
35
+ :refund_attributes,
36
+ :refund_reason_attributes,
37
+ :reimbursement_attributes,
38
+ :reimbursement_type_attributes,
39
+ :report_attributes,
23
40
  :return_authorization_attributes,
41
+ :return_authorization_reason_attributes,
42
+ :role_attributes,
24
43
  :shipment_attributes,
44
+ :shipping_method_attributes,
45
+ :shipping_category_attributes,
25
46
  :source_attributes,
26
47
  :stock_item_attributes,
27
48
  :stock_location_attributes,
28
49
  :stock_movement_attributes,
50
+ :stock_transfer_attributes,
29
51
  :store_attributes,
30
52
  :store_credit_attributes,
53
+ :store_credit_category_attributes,
54
+ :tax_rate_attributes,
55
+ :tax_category_attributes,
31
56
  :taxon_attributes,
32
57
  :taxonomy_attributes,
58
+ :theme_attributes,
33
59
  :user_attributes,
34
60
  :variant_attributes,
35
61
  :wishlist_attributes,
36
- :wished_item_attributes
62
+ :wished_item_attributes,
63
+ :zone_attributes
37
64
  ]
38
65
 
39
66
  mattr_reader(*ATTRIBUTES)
@@ -47,6 +74,8 @@ module Spree
47
74
  state: [:name, :abbr] }
48
75
  ]
49
76
 
77
+ @@asset_attributes = [:type, :viewable_id, :viewable_type, :attachment, :alt, :position]
78
+
50
79
  @@checkout_attributes = [
51
80
  :coupon_code, :email, :shipping_method_id, :special_instructions, :use_billing, :use_shipping,
52
81
  :user_id, :bill_address_id, :ship_address_id, :accept_marketing, :signup_for_an_account
@@ -60,6 +89,8 @@ module Spree
60
89
 
61
90
  @@cms_section_attributes = [:name, :cms_page_id, :fit, :destination, { content: {}, settings: {} }]
62
91
 
92
+ @@custom_domain_attributes = [:url, :default]
93
+
63
94
  @@customer_return_attributes = [:stock_location_id, {
64
95
  return_items_attributes: [:id, :inventory_unit_id, :return_authorization_id, :returned, :pre_tax_amount,
65
96
  :acceptance_status, :exchange_variant_id, :resellable]
@@ -69,24 +100,39 @@ module Spree
69
100
 
70
101
  @@digital_link_attributes = [:access_counter]
71
102
 
103
+ @@export_attributes = [:type, :format, :record_selection, search_params: {}]
104
+
72
105
  @@image_attributes = [:alt, :attachment, :position, :viewable_type, :viewable_id]
73
106
 
107
+ @@integration_attributes = [:type, :active]
108
+
74
109
  @@inventory_unit_attributes = [:shipment, :shipment_id, :variant_id]
75
110
 
111
+ @@invitation_attributes = [:email, :expires_at, :role_id]
112
+
76
113
  @@line_item_attributes = [:id, :variant_id, :quantity]
77
114
 
78
115
  @@menu_attributes = [:name, :locale, :location]
79
116
 
80
- @@menu_item_attributes = [:name, :subtite, :destination, :new_window, :item_type,
117
+ @@menu_item_attributes = [:name, :subtitle, :destination, :new_window, :item_type,
81
118
  :linked_resource_type, :linked_resource_id, :code, :menu_id]
82
119
 
83
- @@option_type_attributes = [:name, :presentation, :option_values_attributes]
120
+ @@option_type_attributes = [:name, :presentation, :position, :filterable,
121
+ option_values_attributes: [:id, :name, :presentation, :position, :_destroy]]
122
+
123
+ @@option_value_attributes = [:name, :presentation, :position]
124
+
125
+ @@page_attributes = [:name, :slug, :meta_title, :meta_description, :meta_keywords]
126
+
127
+ @@page_link_attributes = [:linkable_id, :linkable_type, :position, :label, :url]
84
128
 
85
- @@option_value_attributes = [:name, :presentation]
129
+ @@page_section_attributes = [:type, :name, :position, :asset]
86
130
 
87
131
  @@payment_attributes = [:amount, :payment_method_id, :payment_method]
88
132
 
89
- @@product_properties_attributes = [:property_name, :value, :position]
133
+ @@payment_method_attributes = [:name, :type, :description, :active, :display_on, :auto_capture, :position]
134
+
135
+ @@product_properties_attributes = [:property_name, :property_id, :value, :position, :_destroy]
90
136
 
91
137
  @@product_attributes = [
92
138
  :name, :description, :available_on, :make_active_at, :discontinue_on, :permalink, :meta_description,
@@ -94,24 +140,60 @@ module Spree
94
140
  :option_values_hash, :weight, :height, :width, :depth,
95
141
  :shipping_category_id, :tax_category_id,
96
142
  :cost_currency, :cost_price, :compare_at_price,
97
- :slug,
143
+ :slug, :track_inventory, :backorderable, :barcode, :status,
144
+ :weight_unit, :dimensions_unit,
98
145
  {
99
146
  tag_list: [],
147
+ label_list: [],
100
148
  option_type_ids: [],
101
- taxon_ids: []
149
+ taxon_ids: [],
150
+ store_ids: [],
151
+ product_option_types_attributes: [:id, :option_type_id, :position, :_destroy]
102
152
  }
103
153
  ]
104
154
 
105
- @@property_attributes = [:name, :presentation, :position]
155
+ @@promotion_attributes = [:name, :description, :starts_at, :expires_at, :code, :usage_limit, :path, :match_policy,
156
+ :advertise, :promotion_category_id, :code_prefix, :kind, :number_of_codes, :multi_codes, store_ids: []]
157
+
158
+ @@promotion_rule_attributes = [:type, :preferred_match_policy, user_ids_to_add: [], product_ids_to_add: [], taxon_ids_to_add: []]
159
+
160
+ @@promotion_action_attributes = [:type, :calculator_type, calculator_attributes: {}, promotion_action_line_items_attributes: [:id, :promotion_action_id, :variant_id, :quantity, :_destroy]]
161
+
162
+ @@property_attributes = [:name, :presentation, :position, :kind, :display_on]
163
+
164
+ @@refund_attributes = [:amount, :refund_reason_id]
165
+
166
+ @@refund_reason_attributes = [:name, :active, :mutable]
167
+
168
+ @@reimbursement_attributes = [return_items_attributes: [:id, :override_reimbursement_type_id, :pre_tax_amount, :exchange_variant_id]]
169
+
170
+ @@reimbursement_type_attributes = [:name, :active]
171
+
172
+ @@report_attributes = [:type, :date_from, :date_to, :currency]
106
173
 
107
174
  @@return_authorization_attributes = [:amount, :memo, :stock_location_id, :inventory_units_attributes,
108
- :return_authorization_reason_id]
175
+ :return_authorization_reason_id, {
176
+ return_items_attributes: [:id, :inventory_unit_id, :return_authorization_id, :returned, :pre_tax_amount,
177
+ :acceptance_status, :exchange_variant_id, :resellable]
178
+ }]
179
+
180
+ @@return_authorization_reason_attributes = [:name, :active]
181
+
182
+ @@return_item_attributes = [:inventory_unit_id, :return_authorization_id, :returned, :pre_tax_amount, :acceptance_status, :exchange_variant_id, :resellable]
183
+
184
+ @@role_attributes = [:name]
109
185
 
110
186
  @@shipment_attributes = [
111
187
  :order, :special_instructions, :stock_location_id, :id,
112
188
  :tracking, :address, :inventory_units, :selected_shipping_rate_id
113
189
  ]
114
190
 
191
+ @@shipping_category_attributes = [:name]
192
+
193
+ @@shipping_method_attributes = [:name, :code,:tracking_url, :tax_category_id, :display_on,
194
+ :estimated_transit_business_days_min, :estimated_transit_business_days_max,
195
+ :calculator_type, :preferences, zone_ids: [], shipping_category_ids: [], calculator_attributes: {}]
196
+
115
197
  # month / year may be provided by some sources, or others may elect to use one field
116
198
  @@source_attributes = [
117
199
  :id, :number, :month, :year, :expiry, :verification_value,
@@ -119,7 +201,7 @@ module Spree
119
201
  :gateway_payment_profile_id, :last_digits, :name, :encrypted_data
120
202
  ]
121
203
 
122
- @@stock_item_attributes = [:variant, :stock_location, :backorderable, :variant_id]
204
+ @@stock_item_attributes = [:variant_id, :stock_location_id, :backorderable, :count_on_hand]
123
205
 
124
206
  @@stock_location_attributes = [
125
207
  :name, :active, :address1, :address2, :city, :zipcode,
@@ -131,6 +213,9 @@ module Spree
131
213
  :quantity, :stock_item, :stock_item_id, :originator, :action
132
214
  ]
133
215
 
216
+ @@stock_transfer_attributes = [:source_location_id, :destination_location_id, :reference,
217
+ stock_movements_attributes: [:variant_id, :quantity, :originator_id, :stock_item_id]]
218
+
134
219
  @@store_attributes = [:name, :url, :seo_title, :code, :meta_keywords,
135
220
  :meta_description, :default_currency, :mail_from_address,
136
221
  :customer_support_email, :description, :address, :contact_phone,
@@ -148,28 +233,48 @@ module Spree
148
233
 
149
234
  @@store_credit_attributes = %i[amount currency category_id memo]
150
235
 
236
+ @@store_credit_category_attributes = [:name]
237
+
151
238
  @@taxonomy_attributes = [:name]
152
239
 
240
+ @@tax_category_attributes = [:name, :tax_code,:description, :is_default]
241
+
242
+ @@tax_rate_attributes = [:name, :amount, :zone_id, :tax_category_id, :included_in_price, :show_rate_in_label, :calculator_type, calculator_attributes: {}]
243
+
153
244
  @@taxon_attributes = [
154
245
  :name, :parent_id, :position, :icon, :description, :permalink, :hide_from_nav,
155
- :taxonomy_id, :meta_description, :meta_keywords, :meta_title, :child_index
246
+ :taxonomy_id, :meta_description, :meta_keywords, :meta_title, :child_index,
247
+ :automatic, :rules_match_policy, :sort_order,
248
+ :image, :square_image, :description,
249
+ taxon_rules_attributes: [:id, :type, :value, :match_policy, :_destroy],
156
250
  ]
157
251
 
252
+ @@theme_attributes = [:name, :type, :default]
253
+
158
254
  @@user_attributes = [:email, :bill_address_id, :ship_address_id, :password, :first_name, :last_name,
159
255
  :password_confirmation, :selected_locale, :avatar, :accepts_email_marketing, :phone,
160
256
  { public_metadata: {}, private_metadata: {}, tag_list: [] }]
161
257
 
162
258
  @@variant_attributes = [
163
259
  :name, :presentation, :cost_price, :discontinue_on, :lock_version,
164
- :position, :track_inventory,
260
+ :position, :track_inventory, :tax_category_id,
165
261
  :product_id, :product, :option_values_attributes, :price, :compare_at_price,
166
262
  :weight, :height, :width, :depth, :sku, :barcode, :cost_currency,
167
263
  :weight_unit, :dimensions_unit,
168
- { options: [:name, :value], option_value_ids: [] }
264
+ {
265
+ options: [:id, :name, :value, :position, :_destroy],
266
+ stock_items_attributes: [:id, :count_on_hand, :stock_location_id, :backorderable, :_destroy],
267
+ prices_attributes: [:id, :amount, :compare_at_amount, :currency, :_destroy],
268
+ price: {},
269
+ option_value_variants_attributes: [:id, :option_value_id, :_destroy],
270
+ option_value_ids: []
271
+ }
169
272
  ]
170
273
 
171
274
  @@wishlist_attributes = [:name, :is_default, :is_private]
172
275
 
173
276
  @@wished_item_attributes = [:variant_id, :quantity]
277
+
278
+ @@zone_attributes = [:name, :description, :default_tax, :kind, :states_country_id, country_ids: [], state_ids: []]
174
279
  end
175
280
  end
@@ -20,7 +20,7 @@ Capybara.register_driver :selenium_chrome_headless do |app|
20
20
  options = ::Selenium::WebDriver::Chrome::Options.new
21
21
  options.add_argument '--headless'
22
22
  options.add_argument '--disable-gpu'
23
- options.add_argument '--window-size=1400,900'
23
+ options.add_argument '--window-size=1440,900'
24
24
  options.add_argument '--disable-search-engine-choice-screen'
25
25
 
26
26
  # Disable timers being throttled in background pages/tabs. Useful for parallel test runs.
@@ -0,0 +1,7 @@
1
+ FactoryBot.define do
2
+ factory :integration, class: Spree::Integration do
3
+ type { 'Spree::Integration' }
4
+ store { Spree::Store.default }
5
+ active { true }
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ FactoryBot.define do
2
+ factory :invitation, class: Spree::Invitation do
3
+ email { FFaker::Internet.email }
4
+ inviter { create(:admin_user) }
5
+ end
6
+ end
@@ -7,4 +7,8 @@ FactoryBot.define do
7
7
  association :promotion
8
8
  association :calculator, factory: :flat_rate_calculator
9
9
  end
10
+
11
+ factory :promotion_action_create_line_items, class: Spree::Promotion::Actions::CreateLineItems do
12
+ association :promotion
13
+ end
10
14
  end
@@ -11,6 +11,10 @@ FactoryBot.define do
11
11
  )&.destroy
12
12
  end
13
13
 
14
- after(:create) { |object| object.adjust_count_on_hand(10) }
14
+ transient do
15
+ adjust_count_on_hand { true }
16
+ end
17
+
18
+ after(:create) { |object, evaluator| object.adjust_count_on_hand(10) if evaluator.adjust_count_on_hand }
15
19
  end
16
20
  end
@@ -30,6 +30,19 @@ FactoryBot.define do
30
30
  first_name { FFaker::Name.first_name }
31
31
  last_name { FFaker::Name.last_name }
32
32
 
33
- spree_roles { [Spree::Role.find_by(name: 'admin') || create(:role, name: 'admin')] }
33
+ transient do
34
+ without_admin_role { false }
35
+ end
36
+
37
+ trait :without_admin_role do
38
+ without_admin_role { true }
39
+ end
40
+
41
+ after(:create) do |user, evaluator|
42
+ unless evaluator.without_admin_role
43
+ admin_role = Spree::Role.default_admin_role
44
+ create(:role_user, user: user, role: admin_role) unless user.has_spree_role?(admin_role.name)
45
+ end
46
+ end
34
47
  end
35
48
  end
@@ -12,14 +12,24 @@ module Spree
12
12
  nullify_translatable_fields = @resource_class.translatable_fields.map { |f| "#{f}=null" }.join(', ')
13
13
 
14
14
  unless @resource_class::Translation.exists?
15
- ActiveRecord::Base.connection.execute("
16
- INSERT INTO #{@translations_table} (#{@translatable_fields}, #{@foreign_key}, locale, created_at, updated_at)
17
- SELECT #{@translatable_fields}, id, '#{@default_locale}' as locale, created_at, updated_at FROM #{@resource_class.table_name};
18
- ")
19
- ActiveRecord::Base.connection.execute("
20
- UPDATE #{@resource_class.table_name}
21
- SET #{nullify_translatable_fields};
22
- ")
15
+ # Copy data from main table to translations table
16
+ @resource_class.find_each do |resource|
17
+ translation_attrs = @resource_class.translatable_fields.each_with_object({}) do |field, attrs|
18
+ attrs[field] = resource[field]
19
+ end
20
+
21
+ @resource_class::Translation.create!(
22
+ translation_attrs.merge(
23
+ @foreign_key => resource.id,
24
+ locale: @default_locale,
25
+ created_at: resource.created_at,
26
+ updated_at: resource.updated_at
27
+ )
28
+ )
29
+ end
30
+
31
+ # Nullify translatable fields in main table
32
+ @resource_class.update_all(nullify_translatable_fields)
23
33
  end
24
34
  end
25
35
 
@@ -27,14 +37,16 @@ module Spree
27
37
  translation_table_fields = @resource_class.translatable_fields.map { |f| "#{@translations_table}.#{f}" }.join(', ')
28
38
  row_expression = @resource_class.translatable_fields.count == 1 ? 'ROW' : ''
29
39
 
30
- ActiveRecord::Base.connection.execute("
31
- UPDATE #{@resource_class.table_name}
32
- SET (#{@translatable_fields}) = #{row_expression}(#{translation_table_fields})
33
- FROM #{@translations_table}
34
- WHERE #{@translations_table}.#{@foreign_key} = #{@resource_class.table_name}.id
35
- ")
40
+ # Update main table with translations
41
+ @resource_class::Translation.find_each do |translation|
42
+ resource = @resource_class.find(translation[@foreign_key])
43
+ @resource_class.translatable_fields.each do |field|
44
+ resource.update_column(field, translation[field])
45
+ end
46
+ end
36
47
 
37
- ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{@translations_table}")
48
+ # Clear translations table
49
+ @resource_class::Translation.delete_all
38
50
  end
39
51
  end
40
52
  end
data/lib/tasks/core.rake CHANGED
@@ -184,6 +184,14 @@ use rake db:load_file[/absolute/path/to/sample/filename.rb]}
184
184
  end
185
185
  end
186
186
  end
187
+
188
+ task migrate_admin_users_to_role_users: :environment do |_t, _args|
189
+ Spree.admin_user_class.all.each do |admin_user|
190
+ Spree::Store.all.each do |store|
191
+ store.add_user(admin_user)
192
+ end
193
+ end
194
+ end
187
195
  end
188
196
 
189
197
  namespace :core do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 5.1.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-04-22 00:00:00.000000000 Z
13
+ date: 2025-05-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n-tasks
@@ -526,6 +526,20 @@ dependencies:
526
526
  - - "~>"
527
527
  - !ruby/object:Gem::Version
528
528
  version: 0.3.2
529
+ - !ruby/object:Gem::Dependency
530
+ name: safely_block
531
+ requirement: !ruby/object:Gem::Requirement
532
+ requirements:
533
+ - - "~>"
534
+ - !ruby/object:Gem::Version
535
+ version: '0.4'
536
+ type: :runtime
537
+ prerelease: false
538
+ version_requirements: !ruby/object:Gem::Requirement
539
+ requirements:
540
+ - - "~>"
541
+ - !ruby/object:Gem::Version
542
+ version: '0.4'
529
543
  description: Spree Models, Helpers, Services and core libraries
530
544
  email: hello@spreecommerce.org
531
545
  executables: []
@@ -536,6 +550,7 @@ files:
536
550
  - Rakefile
537
551
  - app/assets/config/spree_core_manifest.js
538
552
  - app/assets/images/google_on_white_hdpi.png
553
+ - app/assets/images/logo.png
539
554
  - app/controllers/spree/base_controller.rb
540
555
  - app/finders/concerns/spree/product_filterable.rb
541
556
  - app/finders/spree/addresses/find.rb
@@ -558,11 +573,13 @@ files:
558
573
  - app/helpers/spree/base_helper.rb
559
574
  - app/helpers/spree/currency_helper.rb
560
575
  - app/helpers/spree/images_helper.rb
576
+ - app/helpers/spree/integrations_helper.rb
561
577
  - app/helpers/spree/locale_helper.rb
562
578
  - app/helpers/spree/mail_helper.rb
563
579
  - app/helpers/spree/products_helper.rb
564
580
  - app/javascript/spree/core/controllers/address_autocomplete_controller.js
565
581
  - app/javascript/spree/core/controllers/address_form_controller.js
582
+ - app/javascript/spree/core/controllers/disable_submit_button_controller.js
566
583
  - app/javascript/spree/core/controllers/enable_button_controller.js
567
584
  - app/javascript/spree/core/helpers/address_autocomplete/google_places_suggestions_provider.js
568
585
  - app/javascript/spree/core/helpers/debounce.js
@@ -581,6 +598,7 @@ files:
581
598
  - app/jobs/spree/variants/remove_line_item_job.rb
582
599
  - app/mailers/spree/base_mailer.rb
583
600
  - app/mailers/spree/export_mailer.rb
601
+ - app/mailers/spree/invitation_mailer.rb
584
602
  - app/mailers/spree/report_mailer.rb
585
603
  - app/mailers/spree/test_mailer.rb
586
604
  - app/models/action_text/rich_text_decorator.rb
@@ -595,6 +613,7 @@ files:
595
613
  - app/models/concerns/spree/has_one_link.rb
596
614
  - app/models/concerns/spree/has_page_links.rb
597
615
  - app/models/concerns/spree/image_methods.rb
616
+ - app/models/concerns/spree/integrations_concern.rb
598
617
  - app/models/concerns/spree/memoized_data.rb
599
618
  - app/models/concerns/spree/metadata.rb
600
619
  - app/models/concerns/spree/multi_searchable.rb
@@ -614,6 +633,7 @@ files:
614
633
  - app/models/concerns/spree/translatable_resource_slug.rb
615
634
  - app/models/concerns/spree/unique_name.rb
616
635
  - app/models/concerns/spree/user_address.rb
636
+ - app/models/concerns/spree/user_management.rb
617
637
  - app/models/concerns/spree/user_methods.rb
618
638
  - app/models/concerns/spree/user_payment_source.rb
619
639
  - app/models/concerns/spree/user_reporting.rb
@@ -669,7 +689,10 @@ files:
669
689
  - app/models/spree/gateway_customer.rb
670
690
  - app/models/spree/image.rb
671
691
  - app/models/spree/image/configuration/active_storage.rb
692
+ - app/models/spree/integration.rb
672
693
  - app/models/spree/inventory_unit.rb
694
+ - app/models/spree/invitation.rb
695
+ - app/models/spree/invitations/store.rb
673
696
  - app/models/spree/legacy_user.rb
674
697
  - app/models/spree/line_item.rb
675
698
  - app/models/spree/log_entry.rb
@@ -941,6 +964,7 @@ files:
941
964
  - app/services/spree/checkout/update.rb
942
965
  - app/services/spree/classifications/reposition.rb
943
966
  - app/services/spree/compare_line_items.rb
967
+ - app/services/spree/country_to_timezone.rb
944
968
  - app/services/spree/coupon_codes/bulk_generate.rb
945
969
  - app/services/spree/coupon_codes/coupon_codes_handler.rb
946
970
  - app/services/spree/credit_cards/destroy.rb
@@ -967,13 +991,16 @@ files:
967
991
  - app/services/spree/seeds/all.rb
968
992
  - app/services/spree/seeds/countries.rb
969
993
  - app/services/spree/seeds/default_reimbursement_types.rb
994
+ - app/services/spree/seeds/digital_delivery.rb
970
995
  - app/services/spree/seeds/payment_methods.rb
996
+ - app/services/spree/seeds/returns_environment.rb
971
997
  - app/services/spree/seeds/roles.rb
972
998
  - app/services/spree/seeds/shipping_categories.rb
973
999
  - app/services/spree/seeds/states.rb
974
1000
  - app/services/spree/seeds/stock_locations.rb
975
1001
  - app/services/spree/seeds/store_credit_categories.rb
976
1002
  - app/services/spree/seeds/stores.rb
1003
+ - app/services/spree/seeds/tax_categories.rb
977
1004
  - app/services/spree/seeds/zones.rb
978
1005
  - app/services/spree/shipments/add_item.rb
979
1006
  - app/services/spree/shipments/change_state.rb
@@ -982,6 +1009,7 @@ files:
982
1009
  - app/services/spree/shipments/remove_item.rb
983
1010
  - app/services/spree/shipments/update.rb
984
1011
  - app/services/spree/stock_locations/stock_items/create.rb
1012
+ - app/services/spree/stores/settings_defaults_by_country.rb
985
1013
  - app/services/spree/tags/bulk_add.rb
986
1014
  - app/services/spree/tags/bulk_remove.rb
987
1015
  - app/services/spree/taxons/add_products.rb
@@ -1007,6 +1035,8 @@ files:
1007
1035
  - app/views/spree/addresses/_form.html.erb
1008
1036
  - app/views/spree/addresses/_suggestions_box.erb
1009
1037
  - app/views/spree/export_mailer/export_done.html.erb
1038
+ - app/views/spree/invitation_mailer/invitation_accepted.html.erb
1039
+ - app/views/spree/invitation_mailer/invitation_email.html.erb
1010
1040
  - app/views/spree/report_mailer/report_done.html.erb
1011
1041
  - app/views/spree/shared/_base_mailer_footer.html.erb
1012
1042
  - app/views/spree/shared/_base_mailer_header.html.erb
@@ -1124,6 +1154,11 @@ files:
1124
1154
  - db/migrate/20250313104226_add_user_type_to_spree_role_users.rb
1125
1155
  - db/migrate/20250313175830_add_unique_index_on_promotion_action_line_items.rb
1126
1156
  - db/migrate/20250314144210_create_spree_taggings_and_spree_tags.rb
1157
+ - db/migrate/20250407085228_create_spree_integrations.rb
1158
+ - db/migrate/20250410061306_create_spree_invitations.rb
1159
+ - db/migrate/20250418174652_add_resource_to_spree_role_users.rb
1160
+ - db/migrate/20250508060800_add_selected_locale_to_spree_admin_users.rb
1161
+ - db/migrate/20250509143831_add_session_id_to_spree_assets.rb
1127
1162
  - db/seeds.rb
1128
1163
  - lib/friendly_id/paranoia.rb
1129
1164
  - lib/generators/spree/authentication/custom/custom_generator.rb
@@ -1216,7 +1251,9 @@ files:
1216
1251
  - lib/spree/testing_support/factories/gateway_customer_factory.rb
1217
1252
  - lib/spree/testing_support/factories/google_data_feed_factory.rb
1218
1253
  - lib/spree/testing_support/factories/image_factory.rb
1254
+ - lib/spree/testing_support/factories/integration_factory.rb
1219
1255
  - lib/spree/testing_support/factories/inventory_unit_factory.rb
1256
+ - lib/spree/testing_support/factories/invitation_factory.rb
1220
1257
  - lib/spree/testing_support/factories/line_item_factory.rb
1221
1258
  - lib/spree/testing_support/factories/log_entry_factory.rb
1222
1259
  - lib/spree/testing_support/factories/options_factory.rb
@@ -1308,9 +1345,9 @@ licenses:
1308
1345
  - BSD-3-Clause
1309
1346
  metadata:
1310
1347
  bug_tracker_uri: https://github.com/spree/spree/issues
1311
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.2
1348
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta
1312
1349
  documentation_uri: https://docs.spreecommerce.org/
1313
- source_code_uri: https://github.com/spree/spree/tree/v5.0.2
1350
+ source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta
1314
1351
  post_install_message:
1315
1352
  rdoc_options: []
1316
1353
  require_paths: