workarea-package_products 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.gitignore +15 -0
  7. data/CHANGELOG.md +343 -0
  8. data/CODE_OF_CONDUCT.md +3 -0
  9. data/CONTRIBUTING.md +3 -0
  10. data/Gemfile +16 -0
  11. data/LICENSE +52 -0
  12. data/README.md +40 -0
  13. data/Rakefile +52 -0
  14. data/app/assets/javascripts/workarea/storefront/package_products/modules/family_product_add_to_cart.js +83 -0
  15. data/app/assets/javascripts/workarea/storefront/package_products/templates/family_add_to_cart_checkbox.jst.ejs +1 -0
  16. data/app/assets/stylesheets/workarea/admin/package_products/components/_product_cards.scss +7 -0
  17. data/app/assets/stylesheets/workarea/storefront/package_products/components/_product_detail_packaged_products.scss +11 -0
  18. data/app/controllers/workarea/admin/create_catalog_package_products_controller.rb +150 -0
  19. data/app/controllers/workarea/admin/create_catalog_products_controller.decorator +25 -0
  20. data/app/controllers/workarea/storefront/cart_items_controller.decorator +29 -0
  21. data/app/controllers/workarea/storefront/products_controller.decorator +8 -0
  22. data/app/models/workarea/catalog/product.decorator +44 -0
  23. data/app/models/workarea/search/admin/catalog_product.decorator +20 -0
  24. data/app/models/workarea/search/storefront/package_product.rb +40 -0
  25. data/app/queries/workarea/search/product_entries.decorator +8 -0
  26. data/app/seeds/workarea/package_product_seeds.rb +41 -0
  27. data/app/services/workarea/add_package_to_cart.rb +79 -0
  28. data/app/view_models/workarea/admin/product_view_model.decorator +35 -0
  29. data/app/view_models/workarea/storefront/product_templates/family_view_model.rb +6 -0
  30. data/app/view_models/workarea/storefront/product_templates/package_view_model.rb +33 -0
  31. data/app/view_models/workarea/storefront/product_view_model.decorator +13 -0
  32. data/app/views/workarea/admin/catalog_products/_create_package_button.html.haml +1 -0
  33. data/app/views/workarea/admin/catalog_products/_packaged_products_card.html.haml +26 -0
  34. data/app/views/workarea/admin/create_catalog_package_products/categorization.html.haml +64 -0
  35. data/app/views/workarea/admin/create_catalog_package_products/content.html.haml +54 -0
  36. data/app/views/workarea/admin/create_catalog_package_products/details.html.haml +87 -0
  37. data/app/views/workarea/admin/create_catalog_package_products/images.html.haml +57 -0
  38. data/app/views/workarea/admin/create_catalog_package_products/packaged_products.html.haml +79 -0
  39. data/app/views/workarea/admin/create_catalog_package_products/publish.html.haml +61 -0
  40. data/app/views/workarea/admin/create_catalog_package_products/setup.html.haml +68 -0
  41. data/app/views/workarea/admin/create_catalog_products/select.html.haml +34 -0
  42. data/app/views/workarea/storefront/cart_items/package.html.haml +59 -0
  43. data/app/views/workarea/storefront/products/package_show.html.haml +49 -0
  44. data/app/views/workarea/storefront/products/templates/_family.html.haml +42 -0
  45. data/app/views/workarea/storefront/products/templates/_package.html.haml +36 -0
  46. data/app/workers/workarea/update_package_products.rb +21 -0
  47. data/bin/rails +16 -0
  48. data/config/initializers/appends.rb +31 -0
  49. data/config/initializers/configuration.rb +6 -0
  50. data/config/initializers/seeds.rb +1 -0
  51. data/config/locales/en.yml +45 -0
  52. data/config/routes.rb +30 -0
  53. data/lib/tasks/sample_data.rake +16 -0
  54. data/lib/workarea/package_products.rb +10 -0
  55. data/lib/workarea/package_products/engine.rb +8 -0
  56. data/lib/workarea/package_products/version.rb +5 -0
  57. data/test/dummy/Rakefile +6 -0
  58. data/test/dummy/app/assets/config/manifest.js +4 -0
  59. data/test/dummy/app/assets/images/.keep +0 -0
  60. data/test/dummy/app/assets/javascripts/application.js +13 -0
  61. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  62. data/test/dummy/app/controllers/application_controller.rb +3 -0
  63. data/test/dummy/app/controllers/concerns/.keep +0 -0
  64. data/test/dummy/app/helpers/application_helper.rb +2 -0
  65. data/test/dummy/app/jobs/application_job.rb +2 -0
  66. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  67. data/test/dummy/app/models/concerns/.keep +0 -0
  68. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  69. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  70. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  71. data/test/dummy/bin/bundle +3 -0
  72. data/test/dummy/bin/rails +4 -0
  73. data/test/dummy/bin/rake +4 -0
  74. data/test/dummy/bin/setup +34 -0
  75. data/test/dummy/bin/update +29 -0
  76. data/test/dummy/config.ru +5 -0
  77. data/test/dummy/config/application.rb +18 -0
  78. data/test/dummy/config/boot.rb +5 -0
  79. data/test/dummy/config/cable.yml +9 -0
  80. data/test/dummy/config/environment.rb +5 -0
  81. data/test/dummy/config/environments/development.rb +54 -0
  82. data/test/dummy/config/environments/production.rb +83 -0
  83. data/test/dummy/config/environments/test.rb +43 -0
  84. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  85. data/test/dummy/config/initializers/assets.rb +11 -0
  86. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  87. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  88. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  89. data/test/dummy/config/initializers/inflections.rb +16 -0
  90. data/test/dummy/config/initializers/mime_types.rb +4 -0
  91. data/test/dummy/config/initializers/session_store.rb +3 -0
  92. data/test/dummy/config/initializers/workarea.rb +5 -0
  93. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  94. data/test/dummy/config/locales/en.yml +23 -0
  95. data/test/dummy/config/puma.rb +47 -0
  96. data/test/dummy/config/routes.rb +5 -0
  97. data/test/dummy/config/secrets.yml +22 -0
  98. data/test/dummy/db/seeds.rb +2 -0
  99. data/test/dummy/lib/assets/.keep +0 -0
  100. data/test/dummy/log/.keep +0 -0
  101. data/test/dummy/public/404.html +67 -0
  102. data/test/dummy/public/422.html +67 -0
  103. data/test/dummy/public/500.html +66 -0
  104. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  105. data/test/dummy/public/apple-touch-icon.png +0 -0
  106. data/test/dummy/public/favicon.ico +1 -0
  107. data/test/integration/workarea/admin/create_catalog_package_products_integration_test.rb +139 -0
  108. data/test/integration/workarea/storefront/package_cart_items_integration_test.rb +47 -0
  109. data/test/integration/workarea/storefront/products_integration_test.decorator +19 -0
  110. data/test/models/workarea/catalog/package_product_test.rb +68 -0
  111. data/test/models/workarea/search/storefront/package_product_test.rb +44 -0
  112. data/test/queries/workarea/search/product_entries_test.decorator +15 -0
  113. data/test/services/workarea/add_package_to_cart_test.rb +46 -0
  114. data/test/system/workarea/admin/activity_system_test.decorator +53 -0
  115. data/test/system/workarea/admin/package_product_copy_system_test.rb +27 -0
  116. data/test/system/workarea/admin/package_products_system_test.rb +101 -0
  117. data/test/system/workarea/admin/product_copy_system_test.decorator +28 -0
  118. data/test/system/workarea/admin/products_system_test.decorator +69 -0
  119. data/test/system/workarea/storefront/categories_with_packages_system_test.rb +172 -0
  120. data/test/system/workarea/storefront/family_product_system_test.rb +58 -0
  121. data/test/system/workarea/storefront/package_product_system_test.rb +42 -0
  122. data/test/test_helper.rb +10 -0
  123. data/test/view_models/workarea/admin/package_product_view_model_test.rb +41 -0
  124. data/test/view_models/workarea/storefront/package_product_view_model_test.rb +27 -0
  125. data/test/view_models/workarea/storefront/package_templates/package_view_model_test.rb +34 -0
  126. data/test/workers/workarea/update_package_products_test.rb +27 -0
  127. data/workarea-package_products.gemspec +24 -0
  128. 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: []