alchemy-solidus 7.6.0 → 8.0.0.b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -26
- data/app/assets/config/alchemy_solidus/manifest.js +1 -0
- data/app/javascript/alchemy_solidus.js +1 -0
- data/app/jobs/alchemy/solidus/base_job.rb +7 -0
- data/app/jobs/alchemy/solidus/invalidate_elements_cache_job.rb +39 -0
- data/app/patches/controllers/alchemy/solidus/alchemy_base_controller_patch.rb +22 -0
- data/app/patches/controllers/alchemy/solidus/application_controller_patch.rb +19 -0
- data/app/patches/controllers/alchemy/solidus/spree_user_confirmations_controller_patch.rb +15 -0
- data/app/patches/controllers/alchemy/solidus/spree_user_passwords_controller_patch.rb +15 -0
- data/app/patches/controllers/alchemy/solidus/spree_user_registrations_controller_patch.rb +15 -0
- data/app/patches/controllers/alchemy/solidus/spree_user_sessions_controller_patch.rb +15 -0
- data/app/patches/helpers/alchemy/solidus/alchemy_base_helper_patch.rb +19 -0
- data/{lib/alchemy/solidus/alchemy_user_extension.rb → app/patches/models/alchemy/solidus/alchemy_user_patch.rb} +6 -2
- data/app/{decorators/models/alchemy/solidus/spree_product_decorator.rb → patches/models/alchemy/solidus/spree_product_patch.rb} +9 -2
- data/app/patches/models/alchemy/solidus/spree_taxon_patch.rb +23 -0
- data/{lib/alchemy/solidus/spree_user_extension.rb → app/patches/models/alchemy/solidus/spree_user_patch.rb} +9 -3
- data/app/patches/models/alchemy/solidus/spree_variant_patch.rb +23 -0
- data/config/importmap.rb +1 -0
- data/config/initializers/alchemy.rb +1 -1
- data/lib/alchemy/solidus/engine.rb +20 -17
- data/lib/alchemy/solidus/version.rb +1 -1
- data/lib/generators/alchemy/solidus/install/install_generator.rb +0 -5
- data/lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb +25 -0
- data/lib/patches/frontend/controllers/alchemy/solidus/spree_store_controller_patch.rb +17 -0
- metadata +47 -25
- data/app/assets/javascripts/alchemy/solidus/admin.js +0 -1
- data/app/decorators/models/alchemy/solidus/spree_taxon_decorator.rb +0 -14
- data/app/decorators/models/alchemy/solidus/spree_variant_decorator.rb +0 -14
- data/app/models/alchemy/solidus/touch_alchemy_ingredients.rb +0 -20
- data/db/migrate/20120229160509_create_alchemy_essence_spree_products.rb +0 -8
- data/db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb +0 -10
- data/db/migrate/20191107135822_create_alchemy_essence_spree_variants.rb +0 -9
- data/lib/alchemy/solidus/alchemy_in_solidus.rb +0 -17
- data/lib/alchemy/solidus/current_user_helpers.rb +0 -9
- data/lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb +0 -9
- data/lib/alchemy/solidus/use_solidus_layout.rb +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a67f29fd0f8fbbd29c8834c7fb99430b6d05925e845748f58884e7ced64737a7
|
|
4
|
+
data.tar.gz: a717544bf570c14692799401c639d4d463b2a55bf408479a0795292070875ec8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6521ba11a01af44a5fbb9537ac6ce25d83d11fcea801fbc116c9aba5beb9ea67affe781c1623ae238cb000e98d23a2ea4b8a0658c108f96d710945eb97cb0b1
|
|
7
|
+
data.tar.gz: 8af9b9eaf72104dc1af249c486bbca1c99e2831867e2b9d3df691f57f604c99c3cc1970e638a1120a367d9e8cf650416a5c34aa776b6f2c4c22b63d667345f02
|
data/README.md
CHANGED
|
@@ -194,32 +194,6 @@ $ bundle exec rake alchemy:install
|
|
|
194
194
|
|
|
195
195
|
and follow the on screen instructions.
|
|
196
196
|
|
|
197
|
-
### Render Alchemy Content in Solidus Layout
|
|
198
|
-
|
|
199
|
-
~~If you plan to render the Alchemy site in the Solidus layout add the following
|
|
200
|
-
to your initializer:~~
|
|
201
|
-
|
|
202
|
-
```ruby
|
|
203
|
-
# config/initializers/alchemy.rb
|
|
204
|
-
require 'alchemy/solidus/use_solidus_layout'
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**NOTE:** Since v2.5.2 this is done automatically for you. If you upgraded from an older version you can safely remove this from your initializers.
|
|
208
|
-
|
|
209
|
-
### Render Alchemy Content in Solidus views
|
|
210
|
-
|
|
211
|
-
~~If you plan to render Alchemy content in your Solidus views (ie. a global header
|
|
212
|
-
or footer section), you need to include the Alchemy view helpers and language
|
|
213
|
-
store in your Solidus controllers with the following addition to your
|
|
214
|
-
initializer:~~
|
|
215
|
-
|
|
216
|
-
```ruby
|
|
217
|
-
# config/initializers/alchemy.rb
|
|
218
|
-
require 'alchemy/solidus/alchemy_in_solidus'
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
**NOTE:** Since v2.5.2 this is done automatically for you. If you upgraded from an older version you can safely remove this from your initializers.
|
|
222
|
-
|
|
223
197
|
### Routing
|
|
224
198
|
|
|
225
199
|
For routing you have a few options.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Alchemy
|
|
2
|
+
module Solidus
|
|
3
|
+
class InvalidateElementsCacheJob < BaseJob
|
|
4
|
+
queue_as :default
|
|
5
|
+
|
|
6
|
+
def perform(model_name, id)
|
|
7
|
+
now = Time.current
|
|
8
|
+
|
|
9
|
+
element_ids = model(model_name)
|
|
10
|
+
.where(related_object_id: id)
|
|
11
|
+
.joins(:element)
|
|
12
|
+
.pluck("alchemy_elements.id")
|
|
13
|
+
elements = ::Alchemy::Element.where(id: element_ids)
|
|
14
|
+
|
|
15
|
+
all_element_ids = get_all_element_ids(elements, element_ids)
|
|
16
|
+
::Alchemy::Element.where(id: all_element_ids.uniq).update_all(updated_at: now)
|
|
17
|
+
|
|
18
|
+
page_ids = elements.joins(page_version: :page).pluck("alchemy_pages.id")
|
|
19
|
+
::Alchemy::Page.where(id: page_ids.uniq).update_all(updated_at: now)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def get_all_element_ids(elements, element_ids)
|
|
25
|
+
parent_element_ids = elements.pluck(:parent_element_id).compact
|
|
26
|
+
parent_elements = ::Alchemy::Element.distinct.where(id: parent_element_ids)
|
|
27
|
+
|
|
28
|
+
if parent_elements.any?
|
|
29
|
+
element_ids += parent_element_ids
|
|
30
|
+
get_all_element_ids(parent_elements, element_ids)
|
|
31
|
+
else
|
|
32
|
+
element_ids
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def model(model_name) = "Alchemy::Ingredients::#{model_name}".constantize
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module AlchemyBaseControllerPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.include Spree::Core::ControllerHelpers::Auth
|
|
8
|
+
base.include Spree::Core::ControllerHelpers::Common
|
|
9
|
+
base.include Spree::Core::ControllerHelpers::Order
|
|
10
|
+
base.include Spree::Core::ControllerHelpers::PaymentParameters
|
|
11
|
+
base.include Spree::Core::ControllerHelpers::Pricing
|
|
12
|
+
base.include Spree::Core::ControllerHelpers::Search
|
|
13
|
+
base.include Spree::Core::ControllerHelpers::Store
|
|
14
|
+
base.include Spree::Core::ControllerHelpers::StrongParameters
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
if defined?(::Alchemy::BaseController)
|
|
18
|
+
::Alchemy::BaseController.prepend self
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module ApplicationControllerPatch
|
|
6
|
+
def spree_current_user
|
|
7
|
+
if Alchemy.user_class_name == "::Alchemy::User"
|
|
8
|
+
current_user
|
|
9
|
+
else
|
|
10
|
+
super
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
if defined?(::ApplicationController)
|
|
15
|
+
::ApplicationController.prepend self
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeUserConfirmationsControllerPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.include Alchemy::ControllerActions
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if defined?(::Spree::UserConfirmationsController)
|
|
11
|
+
::Spree::UserConfirmationsController.prepend self
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeUserPasswordsControllerPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.include Alchemy::ControllerActions
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if defined?(::Spree::UserPasswordsController)
|
|
11
|
+
::Spree::UserPasswordsController.prepend self
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeUserRegistrationsControllerPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.include Alchemy::ControllerActions
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if defined?(::Spree::UserRegistrationsController)
|
|
11
|
+
::Spree::UserRegistrationsController.prepend self
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeUserSessionsControllerPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.include Alchemy::ControllerActions
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if defined?(::Spree::UserSessionsController)
|
|
11
|
+
::Spree::UserSessionsController.prepend self
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module AlchemyBaseHelperPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.include Spree::BaseHelper
|
|
8
|
+
base.include Spree::CheckoutHelper
|
|
9
|
+
base.include Spree::ProductsHelper
|
|
10
|
+
base.include Spree::StoreHelper
|
|
11
|
+
base.include Spree::TaxonsHelper
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
if defined?(::Alchemy::BaseHelper)
|
|
15
|
+
::Alchemy::BaseHelper.prepend self
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Alchemy
|
|
2
2
|
module Solidus
|
|
3
|
-
module
|
|
4
|
-
def self.
|
|
3
|
+
module AlchemyUserPatch
|
|
4
|
+
def self.prepended(klass)
|
|
5
5
|
klass.include Spree::UserMethods
|
|
6
6
|
end
|
|
7
7
|
|
|
@@ -12,6 +12,10 @@ module Alchemy
|
|
|
12
12
|
::Spree::Role.none
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
|
+
|
|
16
|
+
if defined?(::Alchemy::User)
|
|
17
|
+
::Alchemy::User.prepend self
|
|
18
|
+
end
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
end
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Alchemy
|
|
4
4
|
module Solidus
|
|
5
|
-
module
|
|
5
|
+
module SpreeProductPatch
|
|
6
6
|
def self.prepended(base)
|
|
7
|
-
|
|
7
|
+
# Solidus runs touch callbacks on product after_save
|
|
8
|
+
base.after_touch :touch_alchemy_ingredients
|
|
8
9
|
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeProduct", as: :related_object, dependent: :nullify
|
|
9
10
|
end
|
|
10
11
|
|
|
@@ -23,6 +24,12 @@ module Alchemy
|
|
|
23
24
|
taxons.each(&:touch)
|
|
24
25
|
end
|
|
25
26
|
|
|
27
|
+
# Touch all elements that have this product assigned to one of its ingredients.
|
|
28
|
+
# This cascades to all parent elements and pages as well.
|
|
29
|
+
def touch_alchemy_ingredients
|
|
30
|
+
InvalidateElementsCacheJob.perform_later("SpreeProduct", id)
|
|
31
|
+
end
|
|
32
|
+
|
|
26
33
|
::Spree::Product.prepend self
|
|
27
34
|
end
|
|
28
35
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeTaxonPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.after_update :touch_alchemy_ingredients
|
|
8
|
+
base.after_touch :touch_alchemy_ingredients
|
|
9
|
+
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeTaxon", as: :related_object, dependent: :nullify
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
::Spree::Taxon.prepend self
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
# Touch all elements that have this taxon assigned to one of its ingredients.
|
|
17
|
+
# This cascades to all parent elements and pages as well.
|
|
18
|
+
def touch_alchemy_ingredients
|
|
19
|
+
InvalidateElementsCacheJob.perform_later("SpreeTaxon", id)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Alchemy
|
|
2
4
|
module Solidus
|
|
3
|
-
module
|
|
4
|
-
def self.
|
|
5
|
-
|
|
5
|
+
module SpreeUserPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.has_many :folded_pages, class_name: "Alchemy::FoldedPage"
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
def alchemy_display_name
|
|
@@ -16,6 +18,10 @@ module Alchemy
|
|
|
16
18
|
[]
|
|
17
19
|
end
|
|
18
20
|
end
|
|
21
|
+
|
|
22
|
+
if defined?(::Spree::User)
|
|
23
|
+
::Spree::User.prepend self
|
|
24
|
+
end
|
|
19
25
|
end
|
|
20
26
|
end
|
|
21
27
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeVariantPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.after_update :touch_alchemy_ingredients
|
|
8
|
+
base.after_touch :touch_alchemy_ingredients
|
|
9
|
+
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeVariant", as: :related_object, dependent: :nullify
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
::Spree::Variant.prepend self
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
# Touch all elements that have this variant assigned to one of its ingredients.
|
|
17
|
+
# This cascades to all parent elements and pages as well.
|
|
18
|
+
def touch_alchemy_ingredients
|
|
19
|
+
InvalidateElementsCacheJob.perform_later("SpreeVariant", id)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/config/importmap.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
Alchemy.importmap.pin "alchemy_solidus", to: "alchemy_solidus.js", preload: true
|
|
2
2
|
Alchemy.importmap.pin_all_from Alchemy::Solidus::Engine.root.join("app/javascript/alchemy_solidus"),
|
|
3
3
|
under: "alchemy_solidus", preload: true
|
|
4
|
+
Alchemy.importmap.pin "spree", to: "spree.js", preload: true
|
|
@@ -47,5 +47,5 @@ end
|
|
|
47
47
|
|
|
48
48
|
Rails.application.config.after_initialize do
|
|
49
49
|
Alchemy::Modules.register_module(alchemy_module)
|
|
50
|
-
Alchemy.link_dialog_tabs.add(Alchemy::Admin::LinkDialog::ProductTab)
|
|
50
|
+
Alchemy.config.link_dialog_tabs.add("Alchemy::Admin::LinkDialog::ProductTab")
|
|
51
51
|
end
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
require "alchemy_cms"
|
|
2
2
|
require "alchemy/version"
|
|
3
|
+
require "solidus_api"
|
|
3
4
|
require "solidus_core"
|
|
4
5
|
require "solidus_backend"
|
|
5
6
|
require "solidus_support"
|
|
6
7
|
|
|
8
|
+
begin
|
|
9
|
+
require "solidus_frontend"
|
|
10
|
+
rescue LoadError
|
|
11
|
+
# Solidus frontend is not available, but we can still load the engine
|
|
12
|
+
end
|
|
13
|
+
|
|
7
14
|
module Alchemy
|
|
8
15
|
module Solidus
|
|
9
16
|
class Engine < ::Rails::Engine
|
|
10
17
|
include SolidusSupport::EngineExtensions
|
|
18
|
+
|
|
11
19
|
engine_name "alchemy_solidus"
|
|
12
20
|
|
|
13
21
|
initializer "alchemy_solidus.assets", before: "alchemy.importmap" do |app|
|
|
14
|
-
Alchemy.admin_importmaps.add({
|
|
22
|
+
Alchemy.config.admin_importmaps.add({
|
|
15
23
|
importmap_path: root.join("config/importmap.rb"),
|
|
16
24
|
source_paths: [
|
|
17
25
|
root.join("app/javascript")
|
|
@@ -25,26 +33,21 @@ module Alchemy
|
|
|
25
33
|
Alchemy.register_ability ::Spree::Ability
|
|
26
34
|
::Spree::Ability.register_ability ::Alchemy::Permissions
|
|
27
35
|
|
|
28
|
-
if Alchemy.user_class_name == "::Spree::User"
|
|
29
|
-
require "alchemy/solidus/spree_user_extension"
|
|
30
|
-
Spree::User.include Alchemy::Solidus::SpreeUserExtension
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
if Alchemy.user_class_name == "::Alchemy::User"
|
|
34
|
-
require "alchemy/solidus/alchemy_user_extension"
|
|
35
|
-
require "alchemy/solidus/current_user_helpers"
|
|
36
|
-
Alchemy::User.include Alchemy::Solidus::AlchemyUserExtension
|
|
37
|
-
ApplicationController.include Alchemy::Solidus::CurrentUserHelpers
|
|
38
|
-
require "alchemy/solidus/spree_admin_unauthorized_redirect"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
36
|
if SolidusSupport.frontend_available?
|
|
42
37
|
# Allows to render Alchemy content within Solidus' controller views
|
|
43
|
-
|
|
38
|
+
|
|
39
|
+
# Do not prefix element view partials with `spree` namespace.
|
|
40
|
+
# See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
|
|
41
|
+
ActionView::Base.prefix_partial_path_with_controller_namespace = false
|
|
44
42
|
end
|
|
43
|
+
end
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
initializer "alchemy_solidus.patches" do |app|
|
|
46
|
+
if Alchemy.gem_version < Gem::Version.new("7.4.0") && SolidusSupport.backend_available?
|
|
47
|
+
app.config.to_prepare do
|
|
48
|
+
Alchemy::Solidus::SpreeAdminBaseControllerPatch
|
|
49
|
+
end
|
|
50
|
+
end
|
|
48
51
|
end
|
|
49
52
|
end
|
|
50
53
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeAdminBaseControllerPatch
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
if Alchemy.user_class_name == "::Alchemy::User"
|
|
8
|
+
base.unauthorized_redirect = -> do
|
|
9
|
+
if spree_current_user
|
|
10
|
+
flash[:error] = I18n.t("spree.authorization_failure")
|
|
11
|
+
redirect_to spree.root_path
|
|
12
|
+
else
|
|
13
|
+
store_location
|
|
14
|
+
redirect_to Alchemy.login_path
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
if defined?(::Spree::Admin::BaseController)
|
|
21
|
+
::Spree::Admin::BaseController.prepend self
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
module Solidus
|
|
5
|
+
module SpreeStoreControllerPatch
|
|
6
|
+
# Allows to render Alchemy content within Solidus' controller views
|
|
7
|
+
def self.prepended(base)
|
|
8
|
+
base.include Alchemy::ControllerActions
|
|
9
|
+
base.include Alchemy::ConfigurationMethods
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
if defined?(::Spree::StoreController)
|
|
13
|
+
::Spree::StoreController.prepend self
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alchemy-solidus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.0.0.b
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas von Deyen
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: alchemy_cms
|
|
@@ -15,20 +15,40 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 8.0.0.b
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '
|
|
21
|
+
version: '9'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
26
|
- - ">="
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version:
|
|
28
|
+
version: 8.0.0.b
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: '
|
|
31
|
+
version: '9'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: solidus_api
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: 4.0.0
|
|
39
|
+
- - "<"
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '5'
|
|
42
|
+
type: :runtime
|
|
43
|
+
prerelease: false
|
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: 4.0.0
|
|
49
|
+
- - "<"
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '5'
|
|
32
52
|
- !ruby/object:Gem::Dependency
|
|
33
53
|
name: solidus_core
|
|
34
54
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -75,7 +95,7 @@ dependencies:
|
|
|
75
95
|
requirements:
|
|
76
96
|
- - ">="
|
|
77
97
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: 0.
|
|
98
|
+
version: 0.14.0
|
|
79
99
|
- - "<"
|
|
80
100
|
- !ruby/object:Gem::Version
|
|
81
101
|
version: '1'
|
|
@@ -85,7 +105,7 @@ dependencies:
|
|
|
85
105
|
requirements:
|
|
86
106
|
- - ">="
|
|
87
107
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 0.
|
|
108
|
+
version: 0.14.0
|
|
89
109
|
- - "<"
|
|
90
110
|
- !ruby/object:Gem::Version
|
|
91
111
|
version: '1'
|
|
@@ -109,14 +129,14 @@ dependencies:
|
|
|
109
129
|
requirements:
|
|
110
130
|
- - "~>"
|
|
111
131
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: '
|
|
132
|
+
version: '8.0'
|
|
113
133
|
type: :development
|
|
114
134
|
prerelease: false
|
|
115
135
|
version_requirements: !ruby/object:Gem::Requirement
|
|
116
136
|
requirements:
|
|
117
137
|
- - "~>"
|
|
118
138
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: '
|
|
139
|
+
version: '8.0'
|
|
120
140
|
- !ruby/object:Gem::Dependency
|
|
121
141
|
name: shoulda-matchers
|
|
122
142
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -240,7 +260,6 @@ files:
|
|
|
240
260
|
- README.md
|
|
241
261
|
- Rakefile
|
|
242
262
|
- app/assets/config/alchemy_solidus/manifest.js
|
|
243
|
-
- app/assets/javascripts/alchemy/solidus/admin.js
|
|
244
263
|
- app/components/alchemy/admin/link_dialog/product_tab.rb
|
|
245
264
|
- app/components/alchemy/admin/product_select.rb
|
|
246
265
|
- app/components/alchemy/admin/taxon_select.rb
|
|
@@ -248,22 +267,32 @@ files:
|
|
|
248
267
|
- app/components/alchemy/ingredients/spree_product_view.rb
|
|
249
268
|
- app/components/alchemy/ingredients/spree_taxon_view.rb
|
|
250
269
|
- app/components/alchemy/ingredients/spree_variant_view.rb
|
|
251
|
-
- app/decorators/models/alchemy/solidus/spree_product_decorator.rb
|
|
252
|
-
- app/decorators/models/alchemy/solidus/spree_taxon_decorator.rb
|
|
253
|
-
- app/decorators/models/alchemy/solidus/spree_variant_decorator.rb
|
|
254
270
|
- app/javascript/alchemy_solidus.js
|
|
255
271
|
- app/javascript/alchemy_solidus/components/ajax_config.js
|
|
256
272
|
- app/javascript/alchemy_solidus/components/product_select.js
|
|
257
273
|
- app/javascript/alchemy_solidus/components/taxon_select.js
|
|
258
274
|
- app/javascript/alchemy_solidus/components/variant_select.js
|
|
275
|
+
- app/jobs/alchemy/solidus/base_job.rb
|
|
276
|
+
- app/jobs/alchemy/solidus/invalidate_elements_cache_job.rb
|
|
259
277
|
- app/models/alchemy/ingredients/spree_product.rb
|
|
260
278
|
- app/models/alchemy/ingredients/spree_taxon.rb
|
|
261
279
|
- app/models/alchemy/ingredients/spree_variant.rb
|
|
262
|
-
- app/models/alchemy/solidus/touch_alchemy_ingredients.rb
|
|
263
280
|
- app/overrides/alchemy/admin/pages/link/product_link.html.erb.deface
|
|
264
281
|
- app/overrides/alchemy/admin/pages/link/product_link_panel.html.erb.deface
|
|
265
282
|
- app/overrides/alchemy/admin/pages/link/product_link_sl_tab.html.erb.deface
|
|
266
283
|
- app/overrides/alchemy/admin/pages/link/product_link_tab.html.erb.deface
|
|
284
|
+
- app/patches/controllers/alchemy/solidus/alchemy_base_controller_patch.rb
|
|
285
|
+
- app/patches/controllers/alchemy/solidus/application_controller_patch.rb
|
|
286
|
+
- app/patches/controllers/alchemy/solidus/spree_user_confirmations_controller_patch.rb
|
|
287
|
+
- app/patches/controllers/alchemy/solidus/spree_user_passwords_controller_patch.rb
|
|
288
|
+
- app/patches/controllers/alchemy/solidus/spree_user_registrations_controller_patch.rb
|
|
289
|
+
- app/patches/controllers/alchemy/solidus/spree_user_sessions_controller_patch.rb
|
|
290
|
+
- app/patches/helpers/alchemy/solidus/alchemy_base_helper_patch.rb
|
|
291
|
+
- app/patches/models/alchemy/solidus/alchemy_user_patch.rb
|
|
292
|
+
- app/patches/models/alchemy/solidus/spree_product_patch.rb
|
|
293
|
+
- app/patches/models/alchemy/solidus/spree_taxon_patch.rb
|
|
294
|
+
- app/patches/models/alchemy/solidus/spree_user_patch.rb
|
|
295
|
+
- app/patches/models/alchemy/solidus/spree_variant_patch.rb
|
|
267
296
|
- app/views/alchemy/ingredients/_spree_product_editor.html.erb
|
|
268
297
|
- app/views/alchemy/ingredients/_spree_product_view.html.erb
|
|
269
298
|
- app/views/alchemy/ingredients/_spree_taxon_editor.html.erb
|
|
@@ -278,20 +307,13 @@ files:
|
|
|
278
307
|
- config/locales/alchemy_solidus_en.yml
|
|
279
308
|
- config/locales/alchemy_solidus_it.yml
|
|
280
309
|
- config/locales/en.yml
|
|
281
|
-
- db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
|
|
282
|
-
- db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb
|
|
283
|
-
- db/migrate/20191107135822_create_alchemy_essence_spree_variants.rb
|
|
284
310
|
- lib/alchemy-solidus.rb
|
|
285
|
-
- lib/alchemy/solidus/alchemy_in_solidus.rb
|
|
286
|
-
- lib/alchemy/solidus/alchemy_user_extension.rb
|
|
287
|
-
- lib/alchemy/solidus/current_user_helpers.rb
|
|
288
311
|
- lib/alchemy/solidus/engine.rb
|
|
289
|
-
- lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb
|
|
290
|
-
- lib/alchemy/solidus/spree_user_extension.rb
|
|
291
|
-
- lib/alchemy/solidus/use_solidus_layout.rb
|
|
292
312
|
- lib/alchemy/solidus/version.rb
|
|
293
313
|
- lib/generators/alchemy/solidus/install/files/db/seeds/alchemy/pages.yml
|
|
294
314
|
- lib/generators/alchemy/solidus/install/install_generator.rb
|
|
315
|
+
- lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb
|
|
316
|
+
- lib/patches/frontend/controllers/alchemy/solidus/spree_store_controller_patch.rb
|
|
295
317
|
homepage: https://github.com/AlchemyCMS/alchemy-solidus
|
|
296
318
|
licenses:
|
|
297
319
|
- BSD-3-Clause
|
|
@@ -310,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
310
332
|
- !ruby/object:Gem::Version
|
|
311
333
|
version: '0'
|
|
312
334
|
requirements: []
|
|
313
|
-
rubygems_version: 3.
|
|
335
|
+
rubygems_version: 3.7.2
|
|
314
336
|
specification_version: 4
|
|
315
337
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|
|
316
338
|
Content Management System!
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//= require spree
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Alchemy
|
|
4
|
-
module Solidus
|
|
5
|
-
module SpreeTaxonDecorator
|
|
6
|
-
def self.prepended(base)
|
|
7
|
-
base.include Alchemy::Solidus::TouchAlchemyIngredients
|
|
8
|
-
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeTaxon", as: :related_object, dependent: :nullify
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
::Spree::Taxon.prepend self
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Alchemy
|
|
4
|
-
module Solidus
|
|
5
|
-
module SpreeVariantDecorator
|
|
6
|
-
def self.prepended(base)
|
|
7
|
-
base.include Alchemy::Solidus::TouchAlchemyIngredients
|
|
8
|
-
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeVariant", as: :related_object, dependent: :nullify
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
::Spree::Variant.prepend self
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Alchemy
|
|
4
|
-
module Solidus
|
|
5
|
-
module TouchAlchemyIngredients
|
|
6
|
-
extend ActiveSupport::Concern
|
|
7
|
-
|
|
8
|
-
included do
|
|
9
|
-
after_update :touch_alchemy_ingredients
|
|
10
|
-
after_touch :touch_alchemy_ingredients
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
def touch_alchemy_ingredients
|
|
16
|
-
alchemy_ingredients.each(&:touch)
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Allows to render Alchemy content within Solidus' controller views
|
|
2
|
-
Spree::StoreController.include(
|
|
3
|
-
Alchemy::ControllerActions,
|
|
4
|
-
Alchemy::ConfigurationMethods
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
# Hook into SolidusAuthDevise controllers if present
|
|
8
|
-
if defined? Spree::Auth::Engine
|
|
9
|
-
Spree::UserPasswordsController.include Alchemy::ControllerActions
|
|
10
|
-
Spree::UserConfirmationsController.include Alchemy::ControllerActions
|
|
11
|
-
Spree::UserRegistrationsController.include Alchemy::ControllerActions
|
|
12
|
-
Spree::UserSessionsController.include Alchemy::ControllerActions
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# Do not prefix element view partials with `spree` namespace.
|
|
16
|
-
# See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
|
|
17
|
-
ActionView::Base.prefix_partial_path_with_controller_namespace = false
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Allows to use Solidus helpers within Alchemys controller views
|
|
2
|
-
Alchemy::BaseHelper.include(
|
|
3
|
-
Spree::BaseHelper,
|
|
4
|
-
Spree::CheckoutHelper,
|
|
5
|
-
Spree::ProductsHelper,
|
|
6
|
-
Spree::StoreHelper,
|
|
7
|
-
Spree::TaxonsHelper
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
Alchemy::BaseController.include(
|
|
11
|
-
Spree::Core::ControllerHelpers::Auth,
|
|
12
|
-
Spree::Core::ControllerHelpers::Common,
|
|
13
|
-
Spree::Core::ControllerHelpers::Order,
|
|
14
|
-
Spree::Core::ControllerHelpers::PaymentParameters,
|
|
15
|
-
Spree::Core::ControllerHelpers::Pricing,
|
|
16
|
-
Spree::Core::ControllerHelpers::Search,
|
|
17
|
-
Spree::Core::ControllerHelpers::Store,
|
|
18
|
-
Spree::Core::ControllerHelpers::StrongParameters
|
|
19
|
-
)
|