workarea-browse_option 2.1.9 → 2.2.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: 87bbf26ef0c7fbdadf9d42a44f802f99ec2f3259cca9aa460b4e37c4449d66f3
4
- data.tar.gz: a4ec8bbeb5d54d0d6010cdfbf28007d962121352114c97e5a3b379a2c30ff389
3
+ metadata.gz: 7428080b0f34d199647907718ad7ba3651fa9f43366d52795206c7c1aefb1b66
4
+ data.tar.gz: '011391a4e92841bceabea8a0f16c95c9314ea98b0b033cad24288462cfac446d'
5
5
  SHA512:
6
- metadata.gz: 9bc9b9dace0a54b6ca386d8b9a33f4280b7639e918babf319d50b81263c9f98635c177d67b4c2e375f57051e34843ffa123fee2aaa3ee52895575880df0da7b8
7
- data.tar.gz: 38af4c0b77640f62e851d9e7cd1db3263d9c4973766f63ff39b14ed20db13353d806bddce3d99d06316ba7842b6e36d1aba5c9cf7e365e23bd58dca19d88696f
6
+ metadata.gz: 17363cfbeac3374455bedaff9378544a8e7b4c40076fb52766a5d27fa8076efe9cf0bc653098de5ff6941531ce90d422bcb4ec07a1d8f54e9baeacafce7c846e
7
+ data.tar.gz: adfa45e6e371f87dd413d4431247db699783391b0e7250a0cbdd9d72b69d1c8c3913500512e6f84ce94972b478abbe17d67c9e0a9ef15ae54310342811b2648d
@@ -1,19 +1,13 @@
1
- Workarea Browse Option 2.1.9 (2019-11-12)
1
+ Workarea Browse Option 2.2.0 (2020-01-21)
2
2
  --------------------------------------------------------------------------------
3
3
 
4
- * Restore Functionality for Explicit Options Passing
4
+ * Fix v3.5 update issue
5
5
 
6
- Sometimes, an option named "option" will be passed into the product view
7
- model that indicates what should be included in the cache key, and other
8
- times it will be the actual name of the option, like "color". Ensure
9
- that both variants are supported in the `CacheKey#option_parts` for
10
- product view models.
11
6
  Tom Scott
12
7
 
8
+ * Allow passing `option` as the actual option name as well
13
9
 
14
-
15
- Workarea Browse Option 2.1.8 (2019-10-30)
16
- --------------------------------------------------------------------------------
10
+ Tom Scott
17
11
 
18
12
  * Update cache_key.decorator
19
13
 
@@ -34,6 +28,15 @@ Workarea Browse Option 2.1.8 (2019-10-30)
34
28
  This looks like it needs to be updated
35
29
  Jesse McPherson
36
30
 
31
+ * Update test to reflect text ouput for bulk editing products
32
+
33
+ Matt Duffy
34
+
35
+ * Update categorization decoration for workarea v3.5
36
+
37
+ BROWSEOPTION-2
38
+ Matt Duffy
39
+
37
40
 
38
41
 
39
42
  Workarea Browse Option 2.1.7 (2019-10-01)
data/Gemfile CHANGED
@@ -6,4 +6,5 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
6
6
  # development dependencies will be added by default to the :development group.
7
7
  gemspec
8
8
 
9
- gem 'workarea-api', '>= 4.x'
9
+ gem 'workarea', github: 'workarea-commerce/workarea', branch: 'v3.5-stable'
10
+ gem 'workarea-api', github: 'workarea-commerce/workarea-api'
data/Rakefile CHANGED
@@ -40,10 +40,9 @@ task :release do
40
40
  Rake::Task['workarea:changelog'].execute
41
41
  system 'git add CHANGELOG.md'
42
42
  system 'git commit -m "Update CHANGELOG"'
43
- system 'git push origin HEAD'
44
43
 
45
44
  system "git tag -a v#{Workarea::BrowseOption::VERSION} -m 'Tagging #{Workarea::BrowseOption::VERSION}'"
46
- system 'git push --tags'
45
+ system 'git push origin HEAD --follow-tags'
47
46
 
48
47
  system 'gem build workarea-browse_option.gemspec'
49
48
  system "gem push workarea-browse_option-#{Workarea::BrowseOption::VERSION}.gem"
@@ -4,8 +4,8 @@ module Workarea
4
4
 
5
5
  def manual_models
6
6
  return [] if @product.blank?
7
- @manual_models ||= Catalog::Category.by_product(
8
- [@product.id, *BrowseOptionIds.all_for(@product)]
7
+ @manual_models ||= FeaturedCategorization.new(
8
+ @product.id, *BrowseOptionIds.all_for(@product)
9
9
  ).to_a
10
10
  end
11
11
  end
@@ -4,8 +4,7 @@ module Workarea
4
4
 
5
5
  def option_parts
6
6
  option = @product.browse_option
7
- value = @options['option'].presence || @options[option].presence
8
-
7
+ value = @options[option].presence || @options['option'].presence
9
8
  return super unless option.present? && value.present?
10
9
 
11
10
  super.unshift(value.optionize)
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module BrowseOption
3
- VERSION = '2.1.9'.freeze
3
+ VERSION = '2.2.0'.freeze
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session', expire_after: 30.minutes
@@ -7,14 +7,31 @@ module Workarea
7
7
  browse_option: 'color',
8
8
  variants: [{ sku: 'SKU', details: { 'color' => 'red' } }]
9
9
  )
10
+
10
11
  category_one = create_category(product_ids: [product.id])
11
12
  category_two = create_category(
12
13
  product_ids: [BrowseOptionIds.build(product.id, 'red')]
13
14
  )
15
+ category_three = create_category
14
16
 
15
17
  categorization = Categorization.new(product)
16
18
  assert(categorization.manual.include?(category_one.id))
17
19
  assert(categorization.manual.include?(category_two.id))
20
+ refute(categorization.manual.include?(category_three.id))
21
+
22
+ release = create_release(publish_at: 1.day.from_now)
23
+
24
+ release.as_current do
25
+ category_one.update!(product_ids: [])
26
+ category_three.update!(
27
+ product_ids: [BrowseOptionIds.build(product.id, 'red')]
28
+ )
29
+
30
+ categorization = Categorization.new(product)
31
+ refute(categorization.manual.include?(category_one.id))
32
+ assert(categorization.manual.include?(category_two.id))
33
+ assert(categorization.manual.include?(category_three.id))
34
+ end
18
35
  end
19
36
  end
20
37
  end
@@ -21,7 +21,7 @@ module Workarea
21
21
  select 'Color', from: 'bulk_action[settings][browse_option]'
22
22
 
23
23
  click_button t('workarea.admin.bulk_action_product_edits.edit.review_changes')
24
- assert(page.has_content?('Browse Option: Color'))
24
+ assert(page.has_content?('Browse Option Color'))
25
25
  click_button t('workarea.admin.bulk_action_product_edits.review.save_and_finish')
26
26
  assert(page.has_content?('Your product edits are being processed'))
27
27
 
@@ -31,14 +31,19 @@ module Workarea
31
31
  end
32
32
 
33
33
  def test_cache_key
34
- cached_product = Catalog::Product.new(create_product.as_document)
35
- cached_product.browse_option = 'color'
34
+ cached_product = create_product(browse_option: 'color')
36
35
 
37
36
  view_model = ProductViewModel.new(cached_product, color: 'red')
38
37
  assert_match(/red/, view_model.cache_key)
39
38
 
40
39
  view_model = ProductViewModel.new(cached_product, option: 'red')
41
40
  assert_match(/red/, view_model.cache_key)
41
+
42
+ view_model = ProductViewModel.new(cached_product, color: 'red', option: '')
43
+ assert_match(/red/, view_model.cache_key)
44
+
45
+ view_model = ProductViewModel.new(cached_product, color: '', option: 'red')
46
+ assert_match(/red/, view_model.cache_key)
42
47
  end
43
48
 
44
49
  def test_primary_image
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.required_ruby_version = '>= 2.3.0'
19
19
 
20
- s.add_dependency 'workarea', '~> 3.x', '>= 3.3.x'
20
+ s.add_dependency 'workarea', '~> 3.x', '>= 3.5.x'
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-browse_option
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Duffy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-12 00:00:00.000000000 Z
11
+ date: 2020-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.x
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.3.x
22
+ version: 3.5.x
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 3.x
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.3.x
32
+ version: 3.5.x
33
33
  description: Adds browsing products by an option (e.g. color) to the Workarea Commerce
34
34
  Platform
35
35
  email:
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
- rubygems_version: 3.0.6
184
+ rubygems_version: 3.1.2
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Adds browsing products by an option to the Workarea Commerce Platform