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 +4 -4
- data/CHANGELOG.md +13 -10
- data/Gemfile +2 -1
- data/Rakefile +1 -2
- data/app/queries/workarea/categorization.decorator +2 -2
- data/app/view_models/workarea/storefront/product_view_model/cache_key.decorator +1 -2
- data/lib/workarea/browse_option/version.rb +1 -1
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/queries/workarea/browse_option_categorization_test.rb +17 -0
- data/test/system/workarea/admin/bulk_action_product_edit_browse_option_test.rb +1 -1
- data/test/view_models/workarea/storefront/browse_option_product_view_model_test.rb +7 -2
- data/workarea-browse_option.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7428080b0f34d199647907718ad7ba3651fa9f43366d52795206c7c1aefb1b66
|
4
|
+
data.tar.gz: '011391a4e92841bceabea8a0f16c95c9314ea98b0b033cad24288462cfac446d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17363cfbeac3374455bedaff9378544a8e7b4c40076fb52766a5d27fa8076efe9cf0bc653098de5ff6941531ce90d422bcb4ec07a1d8f54e9baeacafce7c846e
|
7
|
+
data.tar.gz: adfa45e6e371f87dd413d4431247db699783391b0e7250a0cbdd9d72b69d1c8c3913500512e6f84ce94972b478abbe17d67c9e0a9ef15ae54310342811b2648d
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,13 @@
|
|
1
|
-
Workarea Browse Option 2.
|
1
|
+
Workarea Browse Option 2.2.0 (2020-01-21)
|
2
2
|
--------------------------------------------------------------------------------
|
3
3
|
|
4
|
-
*
|
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-
|
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 ||=
|
8
|
-
|
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[
|
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)
|
@@ -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
|
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 =
|
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
|
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.
|
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:
|
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.
|
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.
|
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.
|
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
|