alchemy-solidus 7.5.1 → 7.7.0
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/components/alchemy/admin/link_dialog/product_tab.rb +2 -1
- data/app/components/alchemy/admin/product_select.rb +14 -4
- data/app/components/alchemy/admin/taxon_select.rb +46 -0
- data/app/components/alchemy/admin/variant_select.rb +48 -0
- data/app/javascript/alchemy_solidus/components/ajax_config.js +10 -0
- data/app/javascript/alchemy_solidus/components/product_select.js +56 -27
- data/app/javascript/alchemy_solidus/components/taxon_select.js +48 -0
- data/app/javascript/alchemy_solidus/components/variant_select.js +79 -0
- data/app/javascript/alchemy_solidus.js +2 -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} +7 -3
- 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/app/patches/models/alchemy/solidus/spree_user_patch.rb +27 -0
- data/app/patches/models/alchemy/solidus/spree_variant_patch.rb +23 -0
- data/app/views/alchemy/ingredients/_spree_product_editor.html.erb +10 -21
- data/app/views/alchemy/ingredients/_spree_taxon_editor.html.erb +10 -21
- data/app/views/alchemy/ingredients/_spree_variant_editor.html.erb +10 -22
- data/config/initializers/alchemy.rb +20 -20
- data/config/initializers/spree.rb +7 -7
- data/lib/alchemy/solidus/engine.rb +17 -16
- data/lib/alchemy/solidus/version.rb +1 -1
- data/lib/generators/alchemy/solidus/install/install_generator.rb +32 -32
- 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 +26 -22
- 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/javascript/alchemy_solidus/product_select.js +0 -37
- data/app/javascript/alchemy_solidus/select2_config.js +0 -24
- data/app/javascript/alchemy_solidus/taxon_select.js +0 -37
- data/app/javascript/alchemy_solidus/variant_select.js +0 -55
- 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/spree_user_extension.rb +0 -21
- data/lib/alchemy/solidus/use_solidus_layout.rb +0 -19
@@ -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
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Alchemy
|
4
|
+
module Solidus
|
5
|
+
module SpreeUserPatch
|
6
|
+
def self.prepended(base)
|
7
|
+
base.has_many :folded_pages, class_name: "Alchemy::FoldedPage"
|
8
|
+
end
|
9
|
+
|
10
|
+
def alchemy_display_name
|
11
|
+
email
|
12
|
+
end
|
13
|
+
|
14
|
+
def alchemy_roles
|
15
|
+
if has_spree_role?(:admin)
|
16
|
+
%w[admin]
|
17
|
+
else
|
18
|
+
[]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
if defined?(::Spree::User)
|
23
|
+
::Spree::User.prepend self
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
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
|
@@ -3,26 +3,15 @@
|
|
3
3
|
data: spree_product_editor.data_attributes do %>
|
4
4
|
<%= element_form.fields_for(:ingredients, spree_product_editor.ingredient) do |f| %>
|
5
5
|
<%= ingredient_label(spree_product_editor, :product_id) %>
|
6
|
-
<%=
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<%= render Alchemy::Admin::ProductSelect.new(
|
7
|
+
current_alchemy_user.spree_api_key,
|
8
|
+
query_params: spree_product_editor.settings[:query_params],
|
9
|
+
product: spree_product_editor.product
|
10
|
+
) do %>
|
11
|
+
<%= f.text_field :product_id,
|
12
|
+
value: spree_product_editor.product&.id,
|
13
|
+
id: spree_product_editor.form_field_id(:product_id),
|
14
|
+
class: 'full_width' %>
|
15
|
+
<% end %>
|
10
16
|
<% end %>
|
11
17
|
<% end %>
|
12
|
-
|
13
|
-
<script type="module">
|
14
|
-
import "alchemy_solidus/product_select"
|
15
|
-
|
16
|
-
$('#<%= spree_product_editor.form_field_id(:product_id) %>').alchemyProductSelect({
|
17
|
-
placeholder: "<%= Alchemy.t(:search_product, scope: 'solidus') %>",
|
18
|
-
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
19
|
-
baseUrl: "<%= spree.api_products_path %>",
|
20
|
-
query_params: <%== spree_product_editor.settings[:query_params].to_json %>,
|
21
|
-
<% if spree_product_editor.product %>
|
22
|
-
initialSelection: {
|
23
|
-
id: <%= spree_product_editor.product.id %>,
|
24
|
-
text: "<%= spree_product_editor.product.name %>"
|
25
|
-
}
|
26
|
-
<% end %>
|
27
|
-
})
|
28
|
-
</script>
|
@@ -3,26 +3,15 @@
|
|
3
3
|
data: spree_taxon_editor.data_attributes do %>
|
4
4
|
<%= element_form.fields_for(:ingredients, spree_taxon_editor.ingredient) do |f| %>
|
5
5
|
<%= ingredient_label(spree_taxon_editor, :taxon_id) %>
|
6
|
-
<%=
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<%= render Alchemy::Admin::TaxonSelect.new(
|
7
|
+
current_alchemy_user.spree_api_key,
|
8
|
+
query_params: spree_taxon_editor.settings[:query_params],
|
9
|
+
taxon: spree_taxon_editor.ingredient.taxon
|
10
|
+
) do %>
|
11
|
+
<%= f.text_field :taxon_id,
|
12
|
+
value: spree_taxon_editor.taxon&.id,
|
13
|
+
id: spree_taxon_editor.form_field_id(:taxon_id),
|
14
|
+
class: "full_width" %>
|
15
|
+
<% end %>
|
10
16
|
<% end %>
|
11
17
|
<% end %>
|
12
|
-
|
13
|
-
<script type="module">
|
14
|
-
import "alchemy_solidus/taxon_select"
|
15
|
-
|
16
|
-
$('#<%= spree_taxon_editor.form_field_id(:taxon_id) %>').alchemyTaxonSelect({
|
17
|
-
placeholder: "<%= Alchemy.t(:search_taxon, scope: 'solidus') %>",
|
18
|
-
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
19
|
-
baseUrl: "<%= spree.api_taxons_path %>",
|
20
|
-
query_params: <%== spree_taxon_editor.settings[:query_params].to_json %>,
|
21
|
-
<% if spree_taxon_editor.taxon %>
|
22
|
-
initialSelection: {
|
23
|
-
id: <%= spree_taxon_editor.taxon.id %>,
|
24
|
-
text: "<%= spree_taxon_editor.taxon.pretty_name %>"
|
25
|
-
}
|
26
|
-
<% end %>
|
27
|
-
})
|
28
|
-
</script>
|
@@ -3,10 +3,16 @@
|
|
3
3
|
data: spree_variant_editor.data_attributes do %>
|
4
4
|
<%= element_form.fields_for(:ingredients, spree_variant_editor.ingredient) do |f| %>
|
5
5
|
<%= ingredient_label(spree_variant_editor, :variant_id) %>
|
6
|
-
<%=
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<%= render Alchemy::Admin::VariantSelect.new(
|
7
|
+
current_alchemy_user.spree_api_key,
|
8
|
+
query_params: spree_variant_editor.settings[:query_params],
|
9
|
+
variant: spree_variant_editor.ingredient.variant
|
10
|
+
) do %>
|
11
|
+
<%= f.text_field :variant_id,
|
12
|
+
value: spree_variant_editor.variant&.id,
|
13
|
+
id: spree_variant_editor.form_field_id(:variant_id),
|
14
|
+
class: 'alchemy_selectbox full_width' %>
|
15
|
+
<% end %>
|
10
16
|
<% end %>
|
11
17
|
<% end %>
|
12
18
|
|
@@ -28,21 +34,3 @@
|
|
28
34
|
}
|
29
35
|
}
|
30
36
|
</style>
|
31
|
-
|
32
|
-
<script type="module">
|
33
|
-
import "alchemy_solidus/variant_select"
|
34
|
-
|
35
|
-
$('#<%= spree_variant_editor.form_field_id(:variant_id) %>').alchemyVariantSelect({
|
36
|
-
placeholder: "<%= Alchemy.t(:search_variant, scope: 'solidus') %>",
|
37
|
-
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
38
|
-
baseUrl: "<%= spree.api_variants_path %>",
|
39
|
-
query_params: <%== spree_variant_editor.settings[:query_params].to_json %>,
|
40
|
-
<% if spree_variant_editor.variant %>
|
41
|
-
initialSelection: {
|
42
|
-
id: <%= spree_variant_editor.variant.id %>,
|
43
|
-
name: "<%= spree_variant_editor.variant.name %>",
|
44
|
-
options_text: "<%= spree_variant_editor.variant.options_text %>"
|
45
|
-
}
|
46
|
-
<% end %>
|
47
|
-
})
|
48
|
-
</script>
|
@@ -1,27 +1,27 @@
|
|
1
1
|
alchemy_module = {
|
2
|
-
engine_name:
|
3
|
-
name:
|
2
|
+
engine_name: "spree",
|
3
|
+
name: "solidus",
|
4
4
|
navigation: {
|
5
|
-
controller:
|
6
|
-
action:
|
7
|
-
name:
|
8
|
-
icon: Alchemy.gem_version >= Gem::Version.new("7.4.0.a") ?
|
9
|
-
data: {
|
5
|
+
controller: "/spree/admin/orders",
|
6
|
+
action: "index",
|
7
|
+
name: "Store",
|
8
|
+
icon: (Alchemy.gem_version >= Gem::Version.new("7.4.0.a")) ? "shopping-cart" : "shopping-cart-line",
|
9
|
+
data: {turbolinks: false},
|
10
10
|
sub_navigation: [
|
11
11
|
{
|
12
|
-
controller:
|
13
|
-
action:
|
14
|
-
name:
|
12
|
+
controller: "/spree/admin/orders",
|
13
|
+
action: "index",
|
14
|
+
name: "Orders"
|
15
15
|
},
|
16
16
|
{
|
17
|
-
controller:
|
18
|
-
action:
|
19
|
-
name:
|
17
|
+
controller: "/spree/admin/products",
|
18
|
+
action: "index",
|
19
|
+
name: "Products"
|
20
20
|
},
|
21
21
|
{
|
22
|
-
controller:
|
23
|
-
action:
|
24
|
-
name:
|
22
|
+
controller: "/spree/admin/stock_items",
|
23
|
+
action: "index",
|
24
|
+
name: "Stock"
|
25
25
|
}
|
26
26
|
]
|
27
27
|
}
|
@@ -30,12 +30,12 @@ alchemy_module = {
|
|
30
30
|
if defined?(Spree::Auth::Engine)
|
31
31
|
alchemy_module[:navigation][:sub_navigation].push(
|
32
32
|
{
|
33
|
-
controller:
|
34
|
-
action:
|
35
|
-
name:
|
33
|
+
controller: "/spree/admin/users",
|
34
|
+
action: "index",
|
35
|
+
name: "Users"
|
36
36
|
}
|
37
37
|
)
|
38
|
-
Alchemy.user_class_name =
|
38
|
+
Alchemy.user_class_name = "Spree::User"
|
39
39
|
Alchemy.current_user_method = :spree_current_user
|
40
40
|
|
41
41
|
if Alchemy.respond_to?(:logout_method)
|
@@ -24,13 +24,13 @@ Rails.application.config.after_initialize do
|
|
24
24
|
match_path: "/languages"
|
25
25
|
),
|
26
26
|
(if defined?(Alchemy::Devise::Engine)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
config.class::MenuItem.new(
|
28
|
+
label: :users,
|
29
|
+
condition: -> { can?(:index, :alchemy_admin_users) },
|
30
|
+
url: -> { Alchemy::Engine.routes.url_helpers.admin_users_path },
|
31
|
+
match_path: "/users"
|
32
|
+
)
|
33
|
+
end),
|
34
34
|
config.class::MenuItem.new(
|
35
35
|
label: :tags,
|
36
36
|
condition: -> { can?(:index, :alchemy_admin_tags) },
|
@@ -4,6 +4,12 @@ require "solidus_core"
|
|
4
4
|
require "solidus_backend"
|
5
5
|
require "solidus_support"
|
6
6
|
|
7
|
+
begin
|
8
|
+
require "solidus_frontend"
|
9
|
+
rescue LoadError
|
10
|
+
# Solidus frontend is not available, but we can still load the engine
|
11
|
+
end
|
12
|
+
|
7
13
|
module Alchemy
|
8
14
|
module Solidus
|
9
15
|
class Engine < ::Rails::Engine
|
@@ -25,26 +31,21 @@ module Alchemy
|
|
25
31
|
Alchemy.register_ability ::Spree::Ability
|
26
32
|
::Spree::Ability.register_ability ::Alchemy::Permissions
|
27
33
|
|
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
34
|
if SolidusSupport.frontend_available?
|
42
35
|
# Allows to render Alchemy content within Solidus' controller views
|
43
|
-
|
36
|
+
|
37
|
+
# Do not prefix element view partials with `spree` namespace.
|
38
|
+
# See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
|
39
|
+
ActionView::Base.prefix_partial_path_with_controller_namespace = false
|
44
40
|
end
|
41
|
+
end
|
45
42
|
|
46
|
-
|
47
|
-
|
43
|
+
initializer "alchemy_solidus.patches" do |app|
|
44
|
+
if Alchemy.gem_version < Gem::Version.new("7.4.0") && SolidusSupport.backend_available?
|
45
|
+
app.config.to_prepare do
|
46
|
+
Alchemy::Solidus::SpreeAdminBaseControllerPatch
|
47
|
+
end
|
48
|
+
end
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -15,29 +15,29 @@ module Alchemy
|
|
15
15
|
desc "Installs Alchemy Solidus into your App."
|
16
16
|
|
17
17
|
class_option :skip_alchemy_installer,
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
default: false,
|
19
|
+
type: :boolean,
|
20
|
+
desc:
|
21
|
+
"Set true if you don't want to run the Alchemy installer"
|
22
22
|
class_option :skip_alchemy_devise_installer,
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
default: false,
|
24
|
+
type: :boolean,
|
25
|
+
desc:
|
26
|
+
"Set true if you don't want to run the Alchemy Devise installer. NOTE: Automatically skipped if Alchemy::Devise is not available."
|
27
27
|
class_option :skip_spree_custom_user_generator,
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
default: false,
|
29
|
+
type: :boolean,
|
30
|
+
desc:
|
31
|
+
"Set true if you don't want to run the Solidus custom user generator. NOTE: Automatically skipped if Alchemy::Devise is not available."
|
32
32
|
class_option :skip_alchemy_user_generator,
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
default: false,
|
34
|
+
type: :boolean,
|
35
|
+
desc:
|
36
|
+
"Set true if you don't want to generate an admin user. NOTE: Automatically skipped if Alchemy::Devise is not available."
|
37
37
|
class_option :auto_accept,
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
default: false,
|
39
|
+
type: :boolean,
|
40
|
+
desc: "Set true if run from a automated script (ie. on a CI)"
|
41
41
|
|
42
42
|
source_root File.expand_path("files", __dir__)
|
43
43
|
|
@@ -66,7 +66,7 @@ module Alchemy
|
|
66
66
|
|
67
67
|
def run_spree_custom_user_generator
|
68
68
|
if alchemy_devise_present? &&
|
69
|
-
|
69
|
+
!options[:skip_spree_custom_user_generator]
|
70
70
|
arguments =
|
71
71
|
(
|
72
72
|
if options[:auto_accept]
|
@@ -77,15 +77,15 @@ module Alchemy
|
|
77
77
|
)
|
78
78
|
Spree::CustomUserGenerator.start(arguments)
|
79
79
|
gsub_file "lib/spree/authentication_helpers.rb",
|
80
|
-
|
81
|
-
|
80
|
+
/main_app\./,
|
81
|
+
"Alchemy."
|
82
82
|
rake("db:migrate", abort_on_failure: true)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
86
|
def create_admin_user
|
87
87
|
if alchemy_devise_present? && !options[:skip_alchemy_user_generator] &&
|
88
|
-
|
88
|
+
Alchemy::User.count.zero?
|
89
89
|
login = ENV.fetch("ALCHEMY_ADMIN_USER_LOGIN", "admin")
|
90
90
|
email = ENV.fetch("ALCHEMY_ADMIN_USER_EMAIL", "admin@example.com")
|
91
91
|
password = ENV.fetch("ALCHEMY_ADMIN_USER_PASSWORD", "test1234")
|
@@ -123,12 +123,12 @@ module Alchemy
|
|
123
123
|
default: mountpoint
|
124
124
|
)
|
125
125
|
end
|
126
|
-
if File.read(routes_file_path).match SPREE_MOUNT_REGEXP
|
127
|
-
|
126
|
+
sentinel = if File.read(routes_file_path).match SPREE_MOUNT_REGEXP
|
127
|
+
SPREE_MOUNT_REGEXP
|
128
128
|
else
|
129
|
-
|
129
|
+
"Rails.application.routes.draw do\n"
|
130
130
|
end
|
131
|
-
inject_into_file routes_file_path, {
|
131
|
+
inject_into_file routes_file_path, {after: sentinel} do
|
132
132
|
"\n mount Alchemy::Engine, at: '/#{mountpoint.chomp("/")}'\n"
|
133
133
|
end
|
134
134
|
end
|
@@ -136,12 +136,12 @@ module Alchemy
|
|
136
136
|
def set_root_route
|
137
137
|
routes_file_path = Rails.root.join("config", "routes.rb")
|
138
138
|
if options[:auto_accept] ||
|
139
|
-
|
139
|
+
yes?("\nDo you want Alchemy to handle the root route '/'? (y/n)")
|
140
140
|
sentinel = "Rails.application.routes.draw do\n"
|
141
|
-
inject_into_file routes_file_path, {
|
141
|
+
inject_into_file routes_file_path, {after: sentinel} do
|
142
142
|
<<~ROOT_ROUTE
|
143
|
-
|
144
|
-
|
143
|
+
# Let AlchemyCMS handle the root route
|
144
|
+
root to: 'alchemy/pages#index'
|
145
145
|
ROOT_ROUTE
|
146
146
|
end
|
147
147
|
copy_file("db/seeds/alchemy/pages.yml")
|
@@ -151,7 +151,7 @@ module Alchemy
|
|
151
151
|
|
152
152
|
def append_assets
|
153
153
|
append_file "vendor/assets/javascripts/alchemy/admin/all.js",
|
154
|
-
|
154
|
+
"//= require alchemy/solidus/admin.js"
|
155
155
|
end
|
156
156
|
|
157
157
|
private
|
@@ -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: 7.
|
4
|
+
version: 7.7.0
|
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
|
@@ -75,7 +75,7 @@ dependencies:
|
|
75
75
|
requirements:
|
76
76
|
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 0.
|
78
|
+
version: 0.14.0
|
79
79
|
- - "<"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '1'
|
@@ -85,7 +85,7 @@ dependencies:
|
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0.
|
88
|
+
version: 0.14.0
|
89
89
|
- - "<"
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '1'
|
@@ -243,26 +243,37 @@ files:
|
|
243
243
|
- app/assets/javascripts/alchemy/solidus/admin.js
|
244
244
|
- app/components/alchemy/admin/link_dialog/product_tab.rb
|
245
245
|
- app/components/alchemy/admin/product_select.rb
|
246
|
+
- app/components/alchemy/admin/taxon_select.rb
|
247
|
+
- app/components/alchemy/admin/variant_select.rb
|
246
248
|
- app/components/alchemy/ingredients/spree_product_view.rb
|
247
249
|
- app/components/alchemy/ingredients/spree_taxon_view.rb
|
248
250
|
- app/components/alchemy/ingredients/spree_variant_view.rb
|
249
|
-
- app/decorators/models/alchemy/solidus/spree_product_decorator.rb
|
250
|
-
- app/decorators/models/alchemy/solidus/spree_taxon_decorator.rb
|
251
|
-
- app/decorators/models/alchemy/solidus/spree_variant_decorator.rb
|
252
251
|
- app/javascript/alchemy_solidus.js
|
252
|
+
- app/javascript/alchemy_solidus/components/ajax_config.js
|
253
253
|
- app/javascript/alchemy_solidus/components/product_select.js
|
254
|
-
- app/javascript/alchemy_solidus/
|
255
|
-
- app/javascript/alchemy_solidus/
|
256
|
-
- app/
|
257
|
-
- app/
|
254
|
+
- app/javascript/alchemy_solidus/components/taxon_select.js
|
255
|
+
- app/javascript/alchemy_solidus/components/variant_select.js
|
256
|
+
- app/jobs/alchemy/solidus/base_job.rb
|
257
|
+
- app/jobs/alchemy/solidus/invalidate_elements_cache_job.rb
|
258
258
|
- app/models/alchemy/ingredients/spree_product.rb
|
259
259
|
- app/models/alchemy/ingredients/spree_taxon.rb
|
260
260
|
- app/models/alchemy/ingredients/spree_variant.rb
|
261
|
-
- app/models/alchemy/solidus/touch_alchemy_ingredients.rb
|
262
261
|
- app/overrides/alchemy/admin/pages/link/product_link.html.erb.deface
|
263
262
|
- app/overrides/alchemy/admin/pages/link/product_link_panel.html.erb.deface
|
264
263
|
- app/overrides/alchemy/admin/pages/link/product_link_sl_tab.html.erb.deface
|
265
264
|
- app/overrides/alchemy/admin/pages/link/product_link_tab.html.erb.deface
|
265
|
+
- app/patches/controllers/alchemy/solidus/alchemy_base_controller_patch.rb
|
266
|
+
- app/patches/controllers/alchemy/solidus/application_controller_patch.rb
|
267
|
+
- app/patches/controllers/alchemy/solidus/spree_user_confirmations_controller_patch.rb
|
268
|
+
- app/patches/controllers/alchemy/solidus/spree_user_passwords_controller_patch.rb
|
269
|
+
- app/patches/controllers/alchemy/solidus/spree_user_registrations_controller_patch.rb
|
270
|
+
- app/patches/controllers/alchemy/solidus/spree_user_sessions_controller_patch.rb
|
271
|
+
- app/patches/helpers/alchemy/solidus/alchemy_base_helper_patch.rb
|
272
|
+
- app/patches/models/alchemy/solidus/alchemy_user_patch.rb
|
273
|
+
- app/patches/models/alchemy/solidus/spree_product_patch.rb
|
274
|
+
- app/patches/models/alchemy/solidus/spree_taxon_patch.rb
|
275
|
+
- app/patches/models/alchemy/solidus/spree_user_patch.rb
|
276
|
+
- app/patches/models/alchemy/solidus/spree_variant_patch.rb
|
266
277
|
- app/views/alchemy/ingredients/_spree_product_editor.html.erb
|
267
278
|
- app/views/alchemy/ingredients/_spree_product_view.html.erb
|
268
279
|
- app/views/alchemy/ingredients/_spree_taxon_editor.html.erb
|
@@ -277,20 +288,13 @@ files:
|
|
277
288
|
- config/locales/alchemy_solidus_en.yml
|
278
289
|
- config/locales/alchemy_solidus_it.yml
|
279
290
|
- config/locales/en.yml
|
280
|
-
- db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
|
281
|
-
- db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb
|
282
|
-
- db/migrate/20191107135822_create_alchemy_essence_spree_variants.rb
|
283
291
|
- lib/alchemy-solidus.rb
|
284
|
-
- lib/alchemy/solidus/alchemy_in_solidus.rb
|
285
|
-
- lib/alchemy/solidus/alchemy_user_extension.rb
|
286
|
-
- lib/alchemy/solidus/current_user_helpers.rb
|
287
292
|
- lib/alchemy/solidus/engine.rb
|
288
|
-
- lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb
|
289
|
-
- lib/alchemy/solidus/spree_user_extension.rb
|
290
|
-
- lib/alchemy/solidus/use_solidus_layout.rb
|
291
293
|
- lib/alchemy/solidus/version.rb
|
292
294
|
- lib/generators/alchemy/solidus/install/files/db/seeds/alchemy/pages.yml
|
293
295
|
- lib/generators/alchemy/solidus/install/install_generator.rb
|
296
|
+
- lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb
|
297
|
+
- lib/patches/frontend/controllers/alchemy/solidus/spree_store_controller_patch.rb
|
294
298
|
homepage: https://github.com/AlchemyCMS/alchemy-solidus
|
295
299
|
licenses:
|
296
300
|
- BSD-3-Clause
|
@@ -309,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
309
313
|
- !ruby/object:Gem::Version
|
310
314
|
version: '0'
|
311
315
|
requirements: []
|
312
|
-
rubygems_version: 3.6.
|
316
|
+
rubygems_version: 3.6.7
|
313
317
|
specification_version: 4
|
314
318
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|
315
319
|
Content Management System!
|
@@ -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
|