solidus_configurable_kits 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +41 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +17 -0
- data/.github_changelog_generator +2 -0
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/.rubocop.yml +5 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +37 -0
- data/LICENSE +674 -0
- data/README.md +91 -0
- data/Rakefile +6 -0
- data/app/assets/javascripts/solidus_configurable_kits/templates/cart/kit_row.hbs +58 -0
- data/app/assets/javascripts/solidus_configurable_kits/views/cart/kit_row.js +105 -0
- data/app/assets/javascripts/spree/backend/solidus_configurable_kits.js +2 -0
- data/app/assets/javascripts/spree/backend/views/cart/line_item_row.js +135 -0
- data/app/assets/javascripts/spree/backend/views/cart/line_item_table.js +27 -0
- data/app/assets/javascripts/spree/frontend/solidus_configurable_kits.js +44 -0
- data/app/assets/stylesheets/spree/backend/solidus_configurable_kits.css +4 -0
- data/app/assets/stylesheets/spree/frontend/solidus_configurable_kits.css +4 -0
- data/app/controllers/solidus_configurable_kits/admin/kit_requirements_controller.rb +33 -0
- data/app/controllers/solidus_configurable_kits/orders_controller.rb +53 -0
- data/app/decorators/controllers/solidus_configurable_kits/spree/api/line_items_controller_decorator.rb +39 -0
- data/app/decorators/controllers/solidus_configurable_kits/spree/api/variants_controller_decorator.rb +23 -0
- data/app/decorators/models/solidus_configurable_kits/spree/line_item_decorator.rb +102 -0
- data/app/decorators/models/solidus_configurable_kits/spree/order_decorator.rb +19 -0
- data/app/decorators/models/solidus_configurable_kits/spree/product_decorator.rb +31 -0
- data/app/decorators/models/solidus_configurable_kits/spree/shipment_decorator.rb +13 -0
- data/app/decorators/models/solidus_configurable_kits/spree/variant_decorator.rb +49 -0
- data/app/helpers/solidus_configurable_kits/kit_pricing_helper.rb +9 -0
- data/app/models/solidus_configurable_kits/requirement.rb +18 -0
- data/app/models/solidus_configurable_kits/shipping_manifest.rb +16 -0
- data/app/overrides/add_kit_item_to_price_tables.rb +41 -0
- data/app/overrides/add_product_tab.rb +7 -0
- data/app/overrides/change_line_items.rb +9 -0
- data/app/overrides/kit_manifest_on_delivery_page.rb +9 -0
- data/app/overrides/replace_cart_form.rb +9 -0
- data/app/services/solidus_configurable_kits/price_selector.rb +34 -0
- data/app/services/solidus_configurable_kits/pricing_options.rb +42 -0
- data/app/views/solidus_configurable_kits/admin/kit_requirements/_form.html.erb +31 -0
- data/app/views/solidus_configurable_kits/admin/kit_requirements/_table.html.erb +31 -0
- data/app/views/solidus_configurable_kits/admin/kit_requirements/edit.html.erb +14 -0
- data/app/views/solidus_configurable_kits/admin/kit_requirements/index.html.erb +19 -0
- data/app/views/solidus_configurable_kits/admin/kit_requirements/new.html.erb +11 -0
- data/app/views/solidus_configurable_kits/admin/shared/_prices_form_addition.html.erb +8 -0
- data/app/views/solidus_configurable_kits/admin/shared/_prices_table_header_addition.html.erb +1 -0
- data/app/views/solidus_configurable_kits/admin/shared/_prices_table_row_addition.html.erb +1 -0
- data/app/views/solidus_configurable_kits/shared/_configurable_kits_product_tab.html.erb +3 -0
- data/app/views/solidus_configurable_kits/shared/_kit_cart_form.html.erb +5 -0
- data/app/views/solidus_configurable_kits/shared/_kit_manifest_item_price.html.erb +1 -0
- data/app/views/solidus_configurable_kits/shared/_line_item_override.html.erb +7 -0
- data/app/views/spree/api/line_items/_line_item.json.jbuilder +26 -0
- data/app/views/spree/api/variants/_big.json.jbuilder +19 -0
- data/app/views/spree/api/variants/_small.json.jbuilder +22 -0
- data/app/views/spree/orders/_kit_line_item.html.erb +66 -0
- data/app/views/spree/products/_kit_form.html.erb +101 -0
- data/bin/console +17 -0
- data/bin/rails +7 -0
- data/bin/rails-engine +13 -0
- data/bin/rails-sandbox +16 -0
- data/bin/rake +7 -0
- data/bin/sandbox +86 -0
- data/bin/setup +8 -0
- data/config/locales/en.yml +45 -0
- data/config/routes.rb +13 -0
- data/db/migrate/20210417204426_create_solidus_configurable_kits_requirements.rb +15 -0
- data/db/migrate/20210505093839_add_kit_item_id_to_spree_line_items.rb +6 -0
- data/db/migrate/20210506145818_add_kit_item_to_spree_prices.rb +5 -0
- data/db/migrate/20210510133318_remove_quantity_from_solidus_configurable_kits_requirements.rb +5 -0
- data/db/migrate/20210510141953_add_requirement_id_to_spree_line_items.rb +8 -0
- data/db/migrate/20210510154604_rename_spree_line_items_kit_item_id_to_kit_id.rb +5 -0
- data/db/migrate/20210929063101_add_optional_to_solidus_configurable_kits_requirements.rb +7 -0
- data/lib/generators/solidus_configurable_kits/install/install_generator.rb +73 -0
- data/lib/generators/solidus_configurable_kits/install/templates/initializer.rb +6 -0
- data/lib/solidus_configurable_kits/configuration.rb +21 -0
- data/lib/solidus_configurable_kits/engine.rb +27 -0
- data/lib/solidus_configurable_kits/testing_support/factories.rb +12 -0
- data/lib/solidus_configurable_kits/version.rb +5 -0
- data/lib/solidus_configurable_kits.rb +5 -0
- data/solidus_configurable_kits.gemspec +37 -0
- data/spec/models/solidus_configurable_kits/requirement_spec.rb +36 -0
- data/spec/models/spree/line_item_spec.rb +89 -0
- data/spec/models/spree/product_spec.rb +9 -0
- data/spec/requests/solidus_configurable_kits/solidus_configurable_kits/admin/requirements_request_spec.rb +14 -0
- data/spec/spec_helper.rb +38 -0
- metadata +217 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f9baf70045244dcef3c950b5e60e5ef5b74382672e838ab43c92684d0840468e
|
4
|
+
data.tar.gz: bf55efa24e492e8587d3f14435444ec81fa6c1b0b6722de43bf4d394d28a2661
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: be54eba183cbc5f0a24f0992096b08519aba2d7b79a73273fad1a8de65476e8205ac224a04907067379f8b749a404b0254176a86787a969b948796a4151a0719
|
7
|
+
data.tar.gz: a5fd96b5051c60c9756848003fb199318185c3c5ed7fac107e000fd152631ac775a243f48d55f711eebafa1f61135e70f0be811a72dda183b04d9acd1eb2e65c
|
@@ -0,0 +1,41 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
orbs:
|
4
|
+
# Always take the latest version of the orb, this allows us to
|
5
|
+
# run specs against Solidus supported versions only without the need
|
6
|
+
# to change this configuration every time a Solidus version is released
|
7
|
+
# or goes EOL.
|
8
|
+
solidusio_extensions: solidusio/extensions@volatile
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
run-specs-with-postgres:
|
12
|
+
executor: solidusio_extensions/postgres
|
13
|
+
steps:
|
14
|
+
- solidusio_extensions/run-tests
|
15
|
+
run-specs-with-mysql:
|
16
|
+
executor: solidusio_extensions/mysql
|
17
|
+
steps:
|
18
|
+
- solidusio_extensions/run-tests
|
19
|
+
lint-code:
|
20
|
+
executor: solidusio_extensions/sqlite-memory
|
21
|
+
steps:
|
22
|
+
- solidusio_extensions/lint-code
|
23
|
+
|
24
|
+
workflows:
|
25
|
+
"Run specs on supported Solidus versions":
|
26
|
+
jobs:
|
27
|
+
- run-specs-with-postgres
|
28
|
+
- run-specs-with-mysql
|
29
|
+
- lint-code
|
30
|
+
|
31
|
+
"Weekly run specs against master":
|
32
|
+
triggers:
|
33
|
+
- schedule:
|
34
|
+
cron: "0 0 * * 4" # every Thursday
|
35
|
+
filters:
|
36
|
+
branches:
|
37
|
+
only:
|
38
|
+
- master
|
39
|
+
jobs:
|
40
|
+
- run-specs-with-postgres
|
41
|
+
- run-specs-with-mysql
|
data/.gem_release.yml
ADDED
data/.github/stale.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
2
|
+
daysUntilStale: 60
|
3
|
+
# Number of days of inactivity before a stale issue is closed
|
4
|
+
daysUntilClose: false
|
5
|
+
# Issues with these labels will never be considered stale
|
6
|
+
exemptLabels:
|
7
|
+
- pinned
|
8
|
+
- security
|
9
|
+
# Label to use when marking an issue as stale
|
10
|
+
staleLabel: stale
|
11
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
12
|
+
markComment: >
|
13
|
+
This issue has been automatically marked as stale because it has not had
|
14
|
+
recent activity. It might be closed if no further activity occurs. Thank you
|
15
|
+
for your contributions.
|
16
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
17
|
+
closeComment: false
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
|
7
|
+
gem 'solidus', github: 'solidusio/solidus', branch: branch
|
8
|
+
|
9
|
+
# Needed to help Bundler figure out how to resolve dependencies,
|
10
|
+
# otherwise it takes forever to resolve them.
|
11
|
+
# See https://github.com/bundler/bundler/issues/6677
|
12
|
+
gem 'rails', ENV.fetch('RAILS_VERSION', '>0.a')
|
13
|
+
|
14
|
+
# Provides basic authentication functionality for testing parts of your engine
|
15
|
+
gem 'solidus_auth_devise'
|
16
|
+
|
17
|
+
case ENV['DB']
|
18
|
+
when 'mysql'
|
19
|
+
gem 'mysql2'
|
20
|
+
when 'postgresql'
|
21
|
+
gem 'pg'
|
22
|
+
else
|
23
|
+
gem 'sqlite3'
|
24
|
+
end
|
25
|
+
|
26
|
+
gemspec
|
27
|
+
|
28
|
+
# Use a local Gemfile to include development dependencies that might not be
|
29
|
+
# relevant for the project or for other contributors, e.g. pry-byebug.
|
30
|
+
#
|
31
|
+
# We use `send` instead of calling `eval_gemfile` to work around an issue with
|
32
|
+
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
|
33
|
+
send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
|
34
|
+
|
35
|
+
group :test do
|
36
|
+
gem 'shoulda-matchers', '~> 4.0'
|
37
|
+
end
|