spree_frontend 4.6.0 → 4.7.0

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: e47fb4519b72315d61a790677b3592cf1d03cebaa77a8b4f483a5cad9bfb8573
4
- data.tar.gz: 1ccd7a7756fcd9a45df1de4881128621a1dc4dba0f95db9ad287a0e3cc88b16d
3
+ metadata.gz: 66ee07c39f3973037fba8e3d5c16f5de80d7cf7152051058b7138ea98b1e0160
4
+ data.tar.gz: 8413f7984b0dca8fbc785c36d958bf409d7d635dadf997861ed3db8c2f9949c2
5
5
  SHA512:
6
- metadata.gz: d300612e8c06e3e6444ef44922bf71912ca3bf9a2d296abca6f1e4a951c984c4af5222f5f92312c4a8471a0e5ad57d12aff42edc61d41b9667bc4f0b7782feef
7
- data.tar.gz: ce09a386bb4c4488b3cd7369b265dfbe3cbe5578926d152e094c4437c53a30f180ad48d58aec9b38e8979fbee5a68292de4bd09265c043a07ac8bfdf5a432711
6
+ metadata.gz: 4276034e9e0892d040c79e0ddbb31753c926d0e1d2d7a7f43a378d23224e2418ec41480b95be79ac84bce9da899b2f6951a7dabbdfdf367b430464084230363c
7
+ data.tar.gz: 67a583cbbf0c984f0b297b4a258a3391bcef391a54683fa5b7c4bbaaeab5897b37a837e655cba233cfa4835315b908402e5e18fcb6b3371e19bdcd39204f20a3
data/.circleci/config.yml CHANGED
@@ -7,59 +7,14 @@ defaults: &defaults
7
7
  BUNDLE_JOBS: 4
8
8
  BUNDLE_RETRY: 3
9
9
  BUNDLE_PATH: ~/spree/vendor/bundle
10
- RAILS_VERSION: '~> 7.0'
10
+ RAILS_VERSION: '~> 7.1.0'
11
11
  working_directory: ~/spree
12
- docker:
13
- - image: &ruby_2_7_image circleci/ruby:2.7-node-browsers
14
- - image: &redis_image circleci/redis:6.2-alpine
15
-
16
- defaults_3_2: &defaults_3_2
17
- <<: *defaults
18
12
  docker:
19
13
  - image: &ruby_3_2_image circleci/ruby:3.0-node-browsers
20
- - image: *redis_image
21
-
22
- run_tests_2_7: &run_tests_2_7
23
- <<: *defaults
24
- parallelism: 8
25
- steps:
26
- - checkout
27
- - restore_cache:
28
- keys:
29
- - spree-storefront-old-bundle-v10-ruby-2-7-{{ .Branch }}
30
- - spree-storefront-old-bundle-v10-ruby-2-7
31
- - run:
32
- name: Add keyserver
33
- command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
34
- - run:
35
- name: Install libvips
36
- command: sudo apt-get update && sudo apt-get install libvips
37
- - run:
38
- name: Set bundle path
39
- command: bundle config --local path vendor/bundle
40
- - run:
41
- name: Ensure bundle Install
42
- command: |
43
- bundle check || bundle install
44
- - run:
45
- name: Create test app
46
- command: |
47
- bundle exec rake test_app
48
- - run:
49
- name: Run Rspec
50
- command: |
51
- TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
52
- bundle exec rspec --format documentation \
53
- --format RspecJunitFormatter \
54
- -o ~/rspec/rspec.xml \
55
- -- ${TESTFILES}
56
- - store_test_results:
57
- path: ~/rspec
58
- - store_artifacts:
59
- path: tmp/capybara
14
+ - image: &redis_image circleci/redis:6.2-alpine
60
15
 
61
16
  run_tests_3_2: &run_tests_3_2
62
- <<: *defaults_3_2
17
+ <<: *defaults
63
18
  parallelism: 8
64
19
  steps:
65
20
  - checkout
@@ -98,34 +53,8 @@ run_tests_3_2: &run_tests_3_2
98
53
  path: tmp/capybara
99
54
 
100
55
  jobs:
101
- bundle_ruby_2_7:
102
- <<: *defaults
103
- steps:
104
- - checkout
105
- - restore_cache:
106
- keys:
107
- - spree-storefront-old-bundle-v10-ruby-2-7-{{ .Branch }}
108
- - spree-storefront-old-bundle-v10-ruby-2-7
109
- - run:
110
- name: Add keyserver
111
- command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
112
- - run:
113
- name: Install libvips
114
- command: sudo apt-get update && sudo apt-get install libvips
115
- - run:
116
- name: Set bundle path
117
- command: bundle config --local path vendor/bundle
118
- - run:
119
- name: Bundle Install
120
- command: |
121
- bundle check || bundle install
122
- - save_cache:
123
- paths:
124
- - vendor/bundle
125
- key: spree-storefront-old-bundle-v10-ruby-2-7-{{ checksum "Gemfile.lock" }}
126
-
127
56
  bundle_ruby_3_2:
128
- <<: *defaults_3_2
57
+ <<: *defaults
129
58
  steps:
130
59
  - checkout
131
60
  - restore_cache:
@@ -150,31 +79,22 @@ jobs:
150
79
  - vendor/bundle
151
80
  key: spree-storefront-old-bundle-v10-ruby-3-2-{{ checksum "Gemfile.lock" }}
152
81
 
153
- tests_ruby_2_7_rails_7_0_postgres:
154
- <<: *run_tests_2_7
82
+ tests_ruby_3_2_rails_7_1_postgres:
83
+ <<: *run_tests_3_2
155
84
  environment: &postgres_environment
156
85
  <<: *environment
157
86
  DB: postgres
158
87
  DB_HOST: localhost
159
88
  DB_USERNAME: postgres
160
89
  docker:
161
- - image: *ruby_2_7_image
162
- - image: *redis_image
90
+ - image: *ruby_3_2_image
163
91
  - image: &postgres_image circleci/postgres:12-alpine
164
92
  environment:
165
93
  POSTGRES_USER: postgres
166
-
167
- tests_ruby_3_2_rails_7_0_postgres:
168
- <<: *run_tests_3_2
169
- environment:
170
- <<: *postgres_environment
171
- docker:
172
- - image: *ruby_3_2_image
173
- - image: *postgres_image
174
94
  - image: *redis_image
175
95
 
176
- tests_ruby_2_7_rails_7_0_mysql:
177
- <<: *run_tests_2_7
96
+ tests_ruby_3_2_rails_7_1_mysql:
97
+ <<: *run_tests_3_2
178
98
  environment: &mysql_environment
179
99
  <<: *environment
180
100
  DB: mysql
@@ -183,7 +103,7 @@ jobs:
183
103
  COVERAGE: true
184
104
  COVERAGE_DIR: /tmp/workspace/simplecov
185
105
  docker:
186
- - image: *ruby_2_7_image
106
+ - image: *ruby_3_2_image
187
107
  - image: *redis_image
188
108
  - image: &mysql_image circleci/mysql:8-ram
189
109
 
@@ -191,14 +111,10 @@ workflows:
191
111
  version: 2
192
112
  main:
193
113
  jobs:
194
- - bundle_ruby_2_7
195
114
  - bundle_ruby_3_2
196
- - tests_ruby_3_2_rails_7_0_postgres:
115
+ - tests_ruby_3_2_rails_7_1_postgres:
197
116
  requires:
198
117
  - bundle_ruby_3_2
199
- - tests_ruby_2_7_rails_7_0_postgres:
118
+ - tests_ruby_3_2_rails_7_1_mysql:
200
119
  requires:
201
- - bundle_ruby_2_7
202
- - tests_ruby_2_7_rails_7_0_mysql:
203
- requires:
204
- - bundle_ruby_2_7
120
+ - bundle_ruby_3_2
data/.codeclimate.yml CHANGED
@@ -15,8 +15,8 @@ plugins:
15
15
  enabled: false
16
16
  config:
17
17
  file: .rubocop.yml
18
- channel: "rubocop-0-80" # need to keep this value the same as rubocop version
19
- # https://docs.codeclimate.com/v1.0/docs/rubocop#section-using-rubocop-s-newer-versions
18
+ channel: "rubocop-1-50-3" # need to keep this value the same as rubocop version
19
+ # https://docs.codeclimate.com/v1.0/docs/rubocop#section-using-rubocop-s-newer-versions
20
20
  eslint:
21
21
  enabled: true
22
22
  config:
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  require: rubocop-rspec
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.5
4
+ TargetRubyVersion: 3.0
5
5
  Exclude:
6
6
  - '**/sandbox/**/*'
7
7
  - '**/db/migrate/*'
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
6
6
  actionmailer actionpack actionview activejob activemodel activerecord
7
7
  activestorage activesupport railties
8
8
  ].each do |rails_gem|
9
- gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 7.0.0'), require: false
9
+ gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 7.1.0'), require: false
10
10
  end
11
11
 
12
12
  platforms :jruby do
@@ -22,21 +22,21 @@ platforms :ruby do
22
22
  end
23
23
 
24
24
  group :test do
25
- gem 'capybara', '~> 3.24'
26
- gem 'capybara-screenshot', '~> 1.0'
25
+ gem 'capybara'
26
+ gem 'capybara-screenshot'
27
27
  gem 'capybara-select-2'
28
28
  gem 'database_cleaner', '~> 2.0'
29
29
  gem 'email_spec'
30
30
  gem 'factory_bot_rails', '~> 6.0'
31
31
  gem 'multi_json'
32
- gem 'rspec-activemodel-mocks', '~> 1.0'
33
- gem 'rspec-rails', '~> 5.0'
32
+ gem 'rspec-activemodel-mocks'
33
+ gem 'rspec-rails'
34
34
  gem 'rspec-retry'
35
35
  gem 'rspec_junit_formatter'
36
36
  gem 'rswag-specs'
37
37
  gem 'jsonapi-rspec'
38
38
  gem 'simplecov', '0.17.1'
39
- gem 'webmock', '~> 3.7'
39
+ gem 'webmock'
40
40
  gem 'timecop'
41
41
  gem 'rails-controller-testing'
42
42
  end
@@ -48,9 +48,8 @@ group :test, :development do
48
48
  gem 'rubocop', '~> 1.22.3', require: false # bumped
49
49
  gem 'rubocop-rspec', require: false
50
50
  gem 'pry-byebug'
51
- gem 'webdrivers', '~> 4.1'
52
- # Puma 6.0 causes issues in specs due to conflict with capybara version
53
- gem 'puma', '< 6.0'
51
+ gem 'webdrivers'
52
+ gem 'puma'
54
53
  gem 'ffaker'
55
54
  end
56
55
 
@@ -18,7 +18,7 @@ module Spree
18
18
  image_path ||= if logo_attachment&.attached? && logo_attachment&.variable?
19
19
  main_app.cdn_image_url(logo_attachment.variant(resize: '244x104>'))
20
20
  elsif logo_attachment&.attached? && logo_attachment&.image?
21
- main_app.cdn_image_url(current_store.logo)
21
+ main_app.cdn_image_url(logo_attachment)
22
22
  else
23
23
  asset_path('logo/spree_50.png')
24
24
  end
@@ -251,7 +251,7 @@ module Spree
251
251
  end
252
252
 
253
253
  def price_filter_values
254
- ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
254
+ Spree::Deprecation.warn(<<-DEPRECATION, caller)
255
255
  `FrontendHelper#price_filter_values` is deprecated and will be removed in Spree 5.0.
256
256
  Please use `ProductsFiltersHelper#price_filters` method
257
257
  DEPRECATION
@@ -3,7 +3,7 @@ require 'digest'
3
3
  module Spree
4
4
  module NavigationHelper
5
5
  def spree_navigation_data
6
- ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
6
+ Spree::Deprecation.warn(<<-DEPRECATION, caller)
7
7
  NavigationHelper#spree_navigation_data is deprecated and will be removed in Spree 5.0.
8
8
  Please migrate to the new navigation cms system.
9
9
  DEPRECATION
@@ -20,7 +20,7 @@ module Spree
20
20
  end
21
21
 
22
22
  def spree_nav_cache_key(section = 'header')
23
- ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
23
+ Spree::Deprecation.warn(<<-DEPRECATION, caller)
24
24
  NavigationHelper#spree_nav_cache_key is deprecated and will be removed in Spree 5.0.
25
25
  Please migrate to the new navigation cms system.
26
26
  DEPRECATION
@@ -4,7 +4,7 @@ module Spree
4
4
  # that we can use configurations as well as make it easier for end users to override this determination. One idea is
5
5
  # to show the most popular products for a particular taxon (that is an exercise left to the developer.)
6
6
  def taxon_preview(taxon, max = 4)
7
- ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
7
+ Spree::Deprecation.warn(<<-DEPRECATION, caller)
8
8
  TaxonsHelper is deprecated and will be removed in Spree 5.0.
9
9
  Please remove any `helper 'spree/taxons'` from your controllers.
10
10
  DEPRECATION
@@ -118,14 +118,14 @@ module Spree
118
118
  Mobility.with_locale(default_locale) { Spree::Product.friendly.find(product_path_match[1]) }
119
119
  end
120
120
 
121
- new_slug = Mobility.with_locale(locale) { product.slug(fallbacks: default_locale) }
121
+ new_slug = product.slug(locale: locale) || product.slug(locale: default_locale)
122
122
  new_path_slug = "/products/#{new_slug}"
123
123
  default_locale_supplied ? new_path_slug : "/#{locale}/#{new_path_slug}"
124
124
  end
125
125
 
126
126
  def generate_taxon_path(taxon_path_match, previous_locale, locale, default_locale, default_locale_supplied)
127
127
  taxon = Mobility.with_locale(previous_locale) { Spree::Taxon.friendly.find(taxon_path_match[1]) }
128
- new_slug = Mobility.with_locale(locale) { taxon.permalink(fallbacks: default_locale) }
128
+ new_slug = taxon.permalink(locale: locale) || taxon.permalink(locale: default_locale)
129
129
  new_path_slug = "/t/#{new_slug}"
130
130
  default_locale_supplied ? new_path_slug : "/#{locale}/#{new_path_slug}"
131
131
  end
@@ -0,0 +1,18 @@
1
+ Rails.application.config.after_initialize do
2
+ if Spree::Core::Engine.backend_available?
3
+ action = ::Spree::Admin::Actions::ActionBuilder.new('preview', ->(resource) { "/products/#{resource.slug}" }).
4
+ with_icon_key('view.svg').
5
+ with_label_translation_key('admin.utilities.preview').
6
+ with_id('adminPreviewProduct').
7
+ with_target(:blank).
8
+ with_data_attributes({ turbo: false }).
9
+ build
10
+
11
+ Rails.application.config.spree_backend.actions[:product].add(action)
12
+ Rails.application.config.spree_backend.actions[:images].add(action)
13
+ Rails.application.config.spree_backend.actions[:variants].add(action)
14
+ Rails.application.config.spree_backend.actions[:prices].add(action)
15
+ Rails.application.config.spree_backend.actions[:stock].add(action)
16
+ Rails.application.config.spree_backend.actions[:product_properties].add(action)
17
+ end
18
+ end
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  module Frontend
3
- VERSION = '4.6.0'.freeze
3
+ VERSION = '4.7.0'.freeze
4
4
 
5
5
  def self.version
6
6
  VERSION
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
20
20
  }
21
21
 
22
- s.required_ruby_version = '>= 2.5'
22
+ s.required_ruby_version = '>= 3.0'
23
23
 
24
24
  s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
25
25
  s.require_path = 'lib'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-31 00:00:00.000000000 Z
12
+ date: 2023-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_api
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 4.6.0
20
+ version: 4.7.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 4.6.0
27
+ version: 4.7.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: spree_core
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 4.6.0
34
+ version: 4.7.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 4.6.0
41
+ version: 4.7.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: babel-transpiler
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -601,6 +601,7 @@ files:
601
601
  - app/views/spree/users/_address_controls.html.erb
602
602
  - app/views/spree/users/edit.html.erb
603
603
  - app/views/spree/users/show.html.erb
604
+ - config/initializers/admin_actions.rb
604
605
  - config/initializers/assets.rb
605
606
  - config/initializers/canonical_rails.rb
606
607
  - config/routes.rb
@@ -632,9 +633,9 @@ licenses:
632
633
  - BSD-3-Clause
633
634
  metadata:
634
635
  bug_tracker_uri: https://github.com/spree/spree/issues
635
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.6.0
636
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.7.0
636
637
  documentation_uri: https://dev-docs.spreecommerce.org/
637
- source_code_uri: https://github.com/spree/spree/tree/v4.6.0
638
+ source_code_uri: https://github.com/spree/spree/tree/v4.7.0
638
639
  post_install_message:
639
640
  rdoc_options: []
640
641
  require_paths:
@@ -643,7 +644,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
643
644
  requirements:
644
645
  - - ">="
645
646
  - !ruby/object:Gem::Version
646
- version: '2.5'
647
+ version: '3.0'
647
648
  required_rubygems_version: !ruby/object:Gem::Requirement
648
649
  requirements:
649
650
  - - ">="