workarea-package_products 3.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.gitignore +15 -0
- data/CHANGELOG.md +343 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +16 -0
- data/LICENSE +52 -0
- data/README.md +40 -0
- data/Rakefile +52 -0
- data/app/assets/javascripts/workarea/storefront/package_products/modules/family_product_add_to_cart.js +83 -0
- data/app/assets/javascripts/workarea/storefront/package_products/templates/family_add_to_cart_checkbox.jst.ejs +1 -0
- data/app/assets/stylesheets/workarea/admin/package_products/components/_product_cards.scss +7 -0
- data/app/assets/stylesheets/workarea/storefront/package_products/components/_product_detail_packaged_products.scss +11 -0
- data/app/controllers/workarea/admin/create_catalog_package_products_controller.rb +150 -0
- data/app/controllers/workarea/admin/create_catalog_products_controller.decorator +25 -0
- data/app/controllers/workarea/storefront/cart_items_controller.decorator +29 -0
- data/app/controllers/workarea/storefront/products_controller.decorator +8 -0
- data/app/models/workarea/catalog/product.decorator +44 -0
- data/app/models/workarea/search/admin/catalog_product.decorator +20 -0
- data/app/models/workarea/search/storefront/package_product.rb +40 -0
- data/app/queries/workarea/search/product_entries.decorator +8 -0
- data/app/seeds/workarea/package_product_seeds.rb +41 -0
- data/app/services/workarea/add_package_to_cart.rb +79 -0
- data/app/view_models/workarea/admin/product_view_model.decorator +35 -0
- data/app/view_models/workarea/storefront/product_templates/family_view_model.rb +6 -0
- data/app/view_models/workarea/storefront/product_templates/package_view_model.rb +33 -0
- data/app/view_models/workarea/storefront/product_view_model.decorator +13 -0
- data/app/views/workarea/admin/catalog_products/_create_package_button.html.haml +1 -0
- data/app/views/workarea/admin/catalog_products/_packaged_products_card.html.haml +26 -0
- data/app/views/workarea/admin/create_catalog_package_products/categorization.html.haml +64 -0
- data/app/views/workarea/admin/create_catalog_package_products/content.html.haml +54 -0
- data/app/views/workarea/admin/create_catalog_package_products/details.html.haml +87 -0
- data/app/views/workarea/admin/create_catalog_package_products/images.html.haml +57 -0
- data/app/views/workarea/admin/create_catalog_package_products/packaged_products.html.haml +79 -0
- data/app/views/workarea/admin/create_catalog_package_products/publish.html.haml +61 -0
- data/app/views/workarea/admin/create_catalog_package_products/setup.html.haml +68 -0
- data/app/views/workarea/admin/create_catalog_products/select.html.haml +34 -0
- data/app/views/workarea/storefront/cart_items/package.html.haml +59 -0
- data/app/views/workarea/storefront/products/package_show.html.haml +49 -0
- data/app/views/workarea/storefront/products/templates/_family.html.haml +42 -0
- data/app/views/workarea/storefront/products/templates/_package.html.haml +36 -0
- data/app/workers/workarea/update_package_products.rb +21 -0
- data/bin/rails +16 -0
- data/config/initializers/appends.rb +31 -0
- data/config/initializers/configuration.rb +6 -0
- data/config/initializers/seeds.rb +1 -0
- data/config/locales/en.yml +45 -0
- data/config/routes.rb +30 -0
- data/lib/tasks/sample_data.rake +16 -0
- data/lib/workarea/package_products.rb +10 -0
- data/lib/workarea/package_products/engine.rb +8 -0
- data/lib/workarea/package_products/version.rb +5 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/config/application.rb +18 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +9 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +54 -0
- data/test/dummy/config/environments/production.rb +83 -0
- data/test/dummy/config/environments/test.rb +43 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/workarea.rb +5 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/puma.rb +47 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +1 -0
- data/test/integration/workarea/admin/create_catalog_package_products_integration_test.rb +139 -0
- data/test/integration/workarea/storefront/package_cart_items_integration_test.rb +47 -0
- data/test/integration/workarea/storefront/products_integration_test.decorator +19 -0
- data/test/models/workarea/catalog/package_product_test.rb +68 -0
- data/test/models/workarea/search/storefront/package_product_test.rb +44 -0
- data/test/queries/workarea/search/product_entries_test.decorator +15 -0
- data/test/services/workarea/add_package_to_cart_test.rb +46 -0
- data/test/system/workarea/admin/activity_system_test.decorator +53 -0
- data/test/system/workarea/admin/package_product_copy_system_test.rb +27 -0
- data/test/system/workarea/admin/package_products_system_test.rb +101 -0
- data/test/system/workarea/admin/product_copy_system_test.decorator +28 -0
- data/test/system/workarea/admin/products_system_test.decorator +69 -0
- data/test/system/workarea/storefront/categories_with_packages_system_test.rb +172 -0
- data/test/system/workarea/storefront/family_product_system_test.rb +58 -0
- data/test/system/workarea/storefront/package_product_system_test.rb +42 -0
- data/test/test_helper.rb +10 -0
- data/test/view_models/workarea/admin/package_product_view_model_test.rb +41 -0
- data/test/view_models/workarea/storefront/package_product_view_model_test.rb +27 -0
- data/test/view_models/workarea/storefront/package_templates/package_view_model_test.rb +34 -0
- data/test/workers/workarea/update_package_products_test.rb +27 -0
- data/workarea-package_products.gemspec +24 -0
- metadata +189 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Workarea
|
4
|
+
class UpdatePackageProductsTest < Workarea::TestCase
|
5
|
+
include TestCase::SearchIndexing
|
6
|
+
|
7
|
+
def test_perform
|
8
|
+
product = create_product(id: 'PROD1')
|
9
|
+
package = create_product(
|
10
|
+
id: 'PACK',
|
11
|
+
template: 'package',
|
12
|
+
variants: [],
|
13
|
+
product_ids: [
|
14
|
+
product.id,
|
15
|
+
create_product(id: 'PROD2').id,
|
16
|
+
create_product(id: 'PROD3').id
|
17
|
+
]
|
18
|
+
)
|
19
|
+
|
20
|
+
product.destroy
|
21
|
+
UpdatePackageProducts.new.perform(product.id)
|
22
|
+
package.reload
|
23
|
+
|
24
|
+
refute_includes(package.product_ids, product.id)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
|
3
|
+
# Maintain your gem's version:
|
4
|
+
require 'workarea/package_products/version'
|
5
|
+
|
6
|
+
# Describe your gem and declare its dependencies:
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'workarea-package_products'
|
9
|
+
s.version = Workarea::PackageProducts::VERSION
|
10
|
+
s.authors = ['Adam Clarke']
|
11
|
+
s.email = ['adam@revelry.co']
|
12
|
+
s.homepage = 'https://github.com/workarea-commerce/workarea-package-products'
|
13
|
+
s.summary = 'Add support for package products to the Workarea commerce platform'
|
14
|
+
s.description = 'Add support for package products to the Workarea commerce platform'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
|
18
|
+
s.license = 'Business Software License'
|
19
|
+
s.test_files = Dir['spec/**/*']
|
20
|
+
|
21
|
+
s.required_ruby_version = '>= 2.3.0'
|
22
|
+
|
23
|
+
s.add_dependency 'workarea', '~> 3.x', '>= 3.4.x'
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: workarea-package_products
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.3.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Clarke
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: workarea
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.x
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.4.x
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.x
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.4.x
|
33
|
+
description: Add support for package products to the Workarea commerce platform
|
34
|
+
email:
|
35
|
+
- adam@revelry.co
|
36
|
+
executables: []
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- ".editorconfig"
|
41
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
42
|
+
- ".github/ISSUE_TEMPLATE/documentation-request.md"
|
43
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
44
|
+
- ".gitignore"
|
45
|
+
- CHANGELOG.md
|
46
|
+
- CODE_OF_CONDUCT.md
|
47
|
+
- CONTRIBUTING.md
|
48
|
+
- Gemfile
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- app/assets/javascripts/workarea/storefront/package_products/modules/family_product_add_to_cart.js
|
53
|
+
- app/assets/javascripts/workarea/storefront/package_products/templates/family_add_to_cart_checkbox.jst.ejs
|
54
|
+
- app/assets/stylesheets/workarea/admin/package_products/components/_product_cards.scss
|
55
|
+
- app/assets/stylesheets/workarea/storefront/package_products/components/_product_detail_packaged_products.scss
|
56
|
+
- app/controllers/workarea/admin/create_catalog_package_products_controller.rb
|
57
|
+
- app/controllers/workarea/admin/create_catalog_products_controller.decorator
|
58
|
+
- app/controllers/workarea/storefront/cart_items_controller.decorator
|
59
|
+
- app/controllers/workarea/storefront/products_controller.decorator
|
60
|
+
- app/models/workarea/catalog/product.decorator
|
61
|
+
- app/models/workarea/search/admin/catalog_product.decorator
|
62
|
+
- app/models/workarea/search/storefront/package_product.rb
|
63
|
+
- app/queries/workarea/search/product_entries.decorator
|
64
|
+
- app/seeds/workarea/package_product_seeds.rb
|
65
|
+
- app/services/workarea/add_package_to_cart.rb
|
66
|
+
- app/view_models/workarea/admin/product_view_model.decorator
|
67
|
+
- app/view_models/workarea/storefront/product_templates/family_view_model.rb
|
68
|
+
- app/view_models/workarea/storefront/product_templates/package_view_model.rb
|
69
|
+
- app/view_models/workarea/storefront/product_view_model.decorator
|
70
|
+
- app/views/workarea/admin/catalog_products/_create_package_button.html.haml
|
71
|
+
- app/views/workarea/admin/catalog_products/_packaged_products_card.html.haml
|
72
|
+
- app/views/workarea/admin/create_catalog_package_products/categorization.html.haml
|
73
|
+
- app/views/workarea/admin/create_catalog_package_products/content.html.haml
|
74
|
+
- app/views/workarea/admin/create_catalog_package_products/details.html.haml
|
75
|
+
- app/views/workarea/admin/create_catalog_package_products/images.html.haml
|
76
|
+
- app/views/workarea/admin/create_catalog_package_products/packaged_products.html.haml
|
77
|
+
- app/views/workarea/admin/create_catalog_package_products/publish.html.haml
|
78
|
+
- app/views/workarea/admin/create_catalog_package_products/setup.html.haml
|
79
|
+
- app/views/workarea/admin/create_catalog_products/select.html.haml
|
80
|
+
- app/views/workarea/storefront/cart_items/package.html.haml
|
81
|
+
- app/views/workarea/storefront/products/package_show.html.haml
|
82
|
+
- app/views/workarea/storefront/products/templates/_family.html.haml
|
83
|
+
- app/views/workarea/storefront/products/templates/_package.html.haml
|
84
|
+
- app/workers/workarea/update_package_products.rb
|
85
|
+
- bin/rails
|
86
|
+
- config/initializers/appends.rb
|
87
|
+
- config/initializers/configuration.rb
|
88
|
+
- config/initializers/seeds.rb
|
89
|
+
- config/locales/en.yml
|
90
|
+
- config/routes.rb
|
91
|
+
- lib/tasks/sample_data.rake
|
92
|
+
- lib/workarea/package_products.rb
|
93
|
+
- lib/workarea/package_products/engine.rb
|
94
|
+
- lib/workarea/package_products/version.rb
|
95
|
+
- test/dummy/Rakefile
|
96
|
+
- test/dummy/app/assets/config/manifest.js
|
97
|
+
- test/dummy/app/assets/images/.keep
|
98
|
+
- test/dummy/app/assets/javascripts/application.js
|
99
|
+
- test/dummy/app/assets/stylesheets/application.css
|
100
|
+
- test/dummy/app/controllers/application_controller.rb
|
101
|
+
- test/dummy/app/controllers/concerns/.keep
|
102
|
+
- test/dummy/app/helpers/application_helper.rb
|
103
|
+
- test/dummy/app/jobs/application_job.rb
|
104
|
+
- test/dummy/app/mailers/application_mailer.rb
|
105
|
+
- test/dummy/app/models/concerns/.keep
|
106
|
+
- test/dummy/app/views/layouts/application.html.erb
|
107
|
+
- test/dummy/app/views/layouts/mailer.html.erb
|
108
|
+
- test/dummy/app/views/layouts/mailer.text.erb
|
109
|
+
- test/dummy/bin/bundle
|
110
|
+
- test/dummy/bin/rails
|
111
|
+
- test/dummy/bin/rake
|
112
|
+
- test/dummy/bin/setup
|
113
|
+
- test/dummy/bin/update
|
114
|
+
- test/dummy/config.ru
|
115
|
+
- test/dummy/config/application.rb
|
116
|
+
- test/dummy/config/boot.rb
|
117
|
+
- test/dummy/config/cable.yml
|
118
|
+
- test/dummy/config/environment.rb
|
119
|
+
- test/dummy/config/environments/development.rb
|
120
|
+
- test/dummy/config/environments/production.rb
|
121
|
+
- test/dummy/config/environments/test.rb
|
122
|
+
- test/dummy/config/initializers/application_controller_renderer.rb
|
123
|
+
- test/dummy/config/initializers/assets.rb
|
124
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
125
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
126
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
127
|
+
- test/dummy/config/initializers/inflections.rb
|
128
|
+
- test/dummy/config/initializers/mime_types.rb
|
129
|
+
- test/dummy/config/initializers/session_store.rb
|
130
|
+
- test/dummy/config/initializers/workarea.rb
|
131
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
132
|
+
- test/dummy/config/locales/en.yml
|
133
|
+
- test/dummy/config/puma.rb
|
134
|
+
- test/dummy/config/routes.rb
|
135
|
+
- test/dummy/config/secrets.yml
|
136
|
+
- test/dummy/db/seeds.rb
|
137
|
+
- test/dummy/lib/assets/.keep
|
138
|
+
- test/dummy/log/.keep
|
139
|
+
- test/dummy/public/404.html
|
140
|
+
- test/dummy/public/422.html
|
141
|
+
- test/dummy/public/500.html
|
142
|
+
- test/dummy/public/apple-touch-icon-precomposed.png
|
143
|
+
- test/dummy/public/apple-touch-icon.png
|
144
|
+
- test/dummy/public/favicon.ico
|
145
|
+
- test/integration/workarea/admin/create_catalog_package_products_integration_test.rb
|
146
|
+
- test/integration/workarea/storefront/package_cart_items_integration_test.rb
|
147
|
+
- test/integration/workarea/storefront/products_integration_test.decorator
|
148
|
+
- test/models/workarea/catalog/package_product_test.rb
|
149
|
+
- test/models/workarea/search/storefront/package_product_test.rb
|
150
|
+
- test/queries/workarea/search/product_entries_test.decorator
|
151
|
+
- test/services/workarea/add_package_to_cart_test.rb
|
152
|
+
- test/system/workarea/admin/activity_system_test.decorator
|
153
|
+
- test/system/workarea/admin/package_product_copy_system_test.rb
|
154
|
+
- test/system/workarea/admin/package_products_system_test.rb
|
155
|
+
- test/system/workarea/admin/product_copy_system_test.decorator
|
156
|
+
- test/system/workarea/admin/products_system_test.decorator
|
157
|
+
- test/system/workarea/storefront/categories_with_packages_system_test.rb
|
158
|
+
- test/system/workarea/storefront/family_product_system_test.rb
|
159
|
+
- test/system/workarea/storefront/package_product_system_test.rb
|
160
|
+
- test/test_helper.rb
|
161
|
+
- test/view_models/workarea/admin/package_product_view_model_test.rb
|
162
|
+
- test/view_models/workarea/storefront/package_product_view_model_test.rb
|
163
|
+
- test/view_models/workarea/storefront/package_templates/package_view_model_test.rb
|
164
|
+
- test/workers/workarea/update_package_products_test.rb
|
165
|
+
- workarea-package_products.gemspec
|
166
|
+
homepage: https://github.com/workarea-commerce/workarea-package-products
|
167
|
+
licenses:
|
168
|
+
- Business Software License
|
169
|
+
metadata: {}
|
170
|
+
post_install_message:
|
171
|
+
rdoc_options: []
|
172
|
+
require_paths:
|
173
|
+
- lib
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 2.3.0
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubygems_version: 3.0.4
|
186
|
+
signing_key:
|
187
|
+
specification_version: 4
|
188
|
+
summary: Add support for package products to the Workarea commerce platform
|
189
|
+
test_files: []
|