alchemy-solidus 5.0.0 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/Rakefile +18 -7
- data/app/assets/javascripts/alchemy/solidus/admin/product_select.js +27 -22
- data/app/assets/javascripts/alchemy/solidus/admin/select2_config.js +12 -10
- data/app/assets/javascripts/alchemy/solidus/admin.js +1 -0
- data/app/components/alchemy/ingredients/spree_product_view.rb +17 -0
- data/app/components/alchemy/ingredients/spree_taxon_view.rb +17 -0
- data/app/components/alchemy/ingredients/spree_variant_view.rb +17 -0
- data/app/overrides/alchemy/admin/pages/link/product_link.html.erb.deface +5 -0
- data/app/overrides/alchemy/admin/pages/link/product_link_tab.html.erb.deface +7 -0
- data/app/views/alchemy/admin/pages/_product_link.html.erb +30 -0
- data/app/views/alchemy/admin/pages/_product_link_script.html.erb +41 -0
- data/app/views/alchemy/ingredients/_spree_product_view.html.erb +4 -1
- data/app/views/alchemy/ingredients/_spree_taxon_view.html.erb +4 -1
- data/app/views/alchemy/ingredients/_spree_variant_view.html.erb +4 -1
- data/config/locales/alchemy_solidus_en.yml +3 -0
- data/lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb +1 -1
- data/lib/alchemy/solidus/version.rb +1 -1
- data/lib/generators/alchemy/solidus/install/install_generator.rb +100 -55
- metadata +70 -24
- data/app/models/alchemy/essence_spree_product.rb +0 -30
- data/app/models/alchemy/essence_spree_taxon.rb +0 -30
- data/app/models/alchemy/essence_spree_variant.rb +0 -29
- data/app/views/alchemy/essences/_essence_spree_product_editor.html.erb +0 -26
- data/app/views/alchemy/essences/_essence_spree_product_view.html.erb +0 -0
- data/app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb +0 -26
- data/app/views/alchemy/essences/_essence_spree_taxon_view.html.erb +0 -0
- data/app/views/alchemy/essences/_essence_spree_variant_editor.html.erb +0 -26
- data/app/views/alchemy/essences/_essence_spree_variant_view.html.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5b9e5fe0454546aa34cbead4fed12017664b119a068bda5ba08e7064376f008
|
4
|
+
data.tar.gz: 14c4045f805268897fcb4422bee6b0c87aada111c9fefc6d7a6d5eb6b8dab9ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f46f3e3aa9d9f854dcc662e879b48df43f306307f7b7857eb448d02c3cab0292edd7c7f84b3b4ab641ae8f69b950af95ff0803b1e561d57125602cb28daf1b0
|
7
|
+
data.tar.gz: 6a31f2ee758ff475e13c966f6fec4dbf35b19f3f0be0c4f7f0a6893344b5a5e01df1bf4208538e9ba656502759f48e94b14c1c311dbc8d1fbe716a1dbae2c4b2
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ This is a [AlchemyCMS](https://alchemy-cms.com) and [Solidus](https://solidus.io
|
|
13
13
|
|
14
14
|
### Solidus
|
15
15
|
|
16
|
-
This version runs with Solidus
|
16
|
+
This version runs with Solidus v3.0 and up.
|
17
17
|
|
18
18
|
- For a Solidus < 2.11 compatible version please use the `3.1-stable` branch or `3.3.0` gem version.
|
19
19
|
- For a Solidus < 2.6 compatible version please use the `2.3-stable` branch or `2.3.2` gem version.
|
@@ -23,18 +23,20 @@ This version runs with Solidus v2.11 and v3.0.
|
|
23
23
|
|
24
24
|
### Alchemy
|
25
25
|
|
26
|
-
This version runs with Alchemy
|
26
|
+
This version runs with Alchemy v7.0
|
27
27
|
|
28
|
-
- For a Alchemy
|
29
|
-
- For a Alchemy
|
30
|
-
- For a Alchemy
|
28
|
+
- For a Alchemy 6.x compatible version please use the `5.0-stable` branch or `5.0` gem version.
|
29
|
+
- For a Alchemy 5.x compatible version please use the `4.1-stable` branch or `4.1` gem version.
|
30
|
+
- For a Alchemy 4.x compatible version please use the `3.1-stable` branch or `3.3` gem version.
|
31
|
+
- For a Alchemy 4.0 compatible version please use the `2.3-stable` branch or `2.3` gem version.
|
32
|
+
- For a Alchemy 3.x compatible version please use the `1.0-stable` branch or `1.1` gem version.
|
31
33
|
|
32
34
|
## Installation
|
33
35
|
|
34
36
|
Add this line to your applications `Gemfile`:
|
35
37
|
|
36
38
|
```ruby
|
37
|
-
gem 'alchemy-solidus', '~>
|
39
|
+
gem 'alchemy-solidus', '~> 6.0'
|
38
40
|
```
|
39
41
|
|
40
42
|
Install the gem with:
|
data/Rakefile
CHANGED
@@ -10,16 +10,25 @@ require "rspec/core"
|
|
10
10
|
require "rspec/core/rake_task"
|
11
11
|
RSpec::Core::RakeTask.new(:spec)
|
12
12
|
|
13
|
-
task default: [
|
13
|
+
task default: %i[test_setup spec]
|
14
14
|
|
15
15
|
require "active_support/core_ext/string"
|
16
16
|
|
17
17
|
desc "Setup test app"
|
18
18
|
task :test_setup do
|
19
|
-
solidus_version = ENV.fetch("SOLIDUS_VERSION", "
|
20
|
-
solidus_32_install_options =
|
21
|
-
|
22
|
-
|
19
|
+
solidus_version = ENV.fetch("SOLIDUS_VERSION", "4.0")
|
20
|
+
solidus_32_install_options =
|
21
|
+
"--payment-method none --frontend none --no-with-authentication"
|
22
|
+
solidus_33_install_options =
|
23
|
+
"--payment-method none --frontend none --authentication none"
|
24
|
+
solidus_install_options =
|
25
|
+
(
|
26
|
+
if solidus_version == "3.2"
|
27
|
+
solidus_32_install_options
|
28
|
+
else
|
29
|
+
solidus_33_install_options
|
30
|
+
end
|
31
|
+
)
|
23
32
|
Dir.chdir("spec/dummy") do
|
24
33
|
system <<-SETUP.strip_heredoc
|
25
34
|
bin/rake db:environment:set db:drop && \
|
@@ -27,8 +36,10 @@ task :test_setup do
|
|
27
36
|
bin/rails g gutentag:migration_versions && \
|
28
37
|
bin/rails g solidus:install --force --auto-accept --no-seed --no-sample #{solidus_install_options} && \
|
29
38
|
bin/rails g solidus_frontend:install --force --auto-accept && \
|
30
|
-
bin/rails
|
31
|
-
bin/
|
39
|
+
bin/rails javascript:install:esbuild && \
|
40
|
+
bin/rails g alchemy:solidus:install --auto-accept --skip && \
|
41
|
+
bin/rake db:test:prepare && \
|
42
|
+
bin/rails javascript:build
|
32
43
|
SETUP
|
33
44
|
exit($?.exitstatus) unless $?.success?
|
34
45
|
end
|
@@ -1,32 +1,37 @@
|
|
1
1
|
//= require alchemy/solidus/admin/select2_config
|
2
2
|
|
3
|
-
$.fn.alchemyProductSelect = function(options) {
|
3
|
+
$.fn.alchemyProductSelect = function (options) {
|
4
4
|
var config = Alchemy.Solidus.getSelect2Config(options)
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
function formatResultObject(product) {
|
7
|
+
return {
|
8
|
+
id: product.id,
|
9
|
+
text: product.name,
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
var select2config = Object.assign(config, {
|
14
|
+
ajax: Object.assign(config.ajax, {
|
15
|
+
data: function (term, page) {
|
9
16
|
return {
|
10
|
-
q:
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
q: Object.assign(
|
18
|
+
{
|
19
|
+
name_cont: term,
|
20
|
+
},
|
21
|
+
options.query_params
|
22
|
+
),
|
23
|
+
page: page,
|
14
24
|
}
|
15
25
|
},
|
16
|
-
results: function(data, page) {
|
26
|
+
results: function (data, page) {
|
17
27
|
return {
|
18
|
-
results: data.products.map(
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
}),
|
24
|
-
more: page * data.per_page < data.total_count
|
28
|
+
results: data.products.map(
|
29
|
+
options.formatResultObject || formatResultObject
|
30
|
+
),
|
31
|
+
more: page * data.per_page < data.total_count,
|
25
32
|
}
|
26
|
-
}
|
27
|
-
},
|
28
|
-
|
29
|
-
|
30
|
-
}
|
31
|
-
}))
|
33
|
+
},
|
34
|
+
}),
|
35
|
+
})
|
36
|
+
this.select2(select2config)
|
32
37
|
}
|
@@ -1,24 +1,26 @@
|
|
1
1
|
Alchemy = window.Alchemy || {}
|
2
2
|
Alchemy.Solidus = Alchemy.Solidus || {}
|
3
3
|
|
4
|
-
Alchemy.Solidus.getSelect2Config = function(options) {
|
4
|
+
Alchemy.Solidus.getSelect2Config = function (options) {
|
5
5
|
var headers = {
|
6
|
-
|
6
|
+
Authorization: "Bearer " + options.apiToken,
|
7
7
|
}
|
8
8
|
|
9
9
|
return {
|
10
10
|
placeholder: options.placeholder,
|
11
11
|
minimumInputLength: 3,
|
12
|
-
initSelection:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
initSelection:
|
13
|
+
options.initSelection ||
|
14
|
+
function (_$el, callback) {
|
15
|
+
if (options.initialSelection) {
|
16
|
+
callback(options.initialSelection)
|
17
|
+
}
|
18
|
+
},
|
17
19
|
ajax: {
|
18
20
|
url: options.baseUrl,
|
19
|
-
datatype:
|
21
|
+
datatype: "json",
|
20
22
|
quietMillis: 300,
|
21
|
-
params: { headers: headers }
|
22
|
-
}
|
23
|
+
params: { headers: headers },
|
24
|
+
},
|
23
25
|
}
|
24
26
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= form_tag do %>
|
2
|
+
<%= render_message do %>
|
3
|
+
<h3><%= Alchemy.t(:choose_product_to_link) %></h3>
|
4
|
+
<% end %>
|
5
|
+
<div class="input select">
|
6
|
+
<label for="product_link" class="control-label">
|
7
|
+
<%= Spree::Product.model_name.human %>
|
8
|
+
</label>
|
9
|
+
<input type="text" id="product_link" class="alchemy_selectbox full_width">
|
10
|
+
</div>
|
11
|
+
<div class="input text">
|
12
|
+
<label for="product_link_title" class="control-label">
|
13
|
+
<%= Alchemy.t(:link_title) %>
|
14
|
+
</label>
|
15
|
+
<%= text_field_tag "product_link_title", '', class: 'link_title' %>
|
16
|
+
</div>
|
17
|
+
<div class="input select">
|
18
|
+
<label for="product_link_target" class="control-label">
|
19
|
+
<%= Alchemy.t("Open Link in") %>
|
20
|
+
</label>
|
21
|
+
<%= select_tag 'product_link_target',
|
22
|
+
options_for_select(Alchemy::Page.link_target_options),
|
23
|
+
class: 'alchemy_selectbox link_target' %>
|
24
|
+
</div>
|
25
|
+
<div class="submit">
|
26
|
+
<%= button_tag Alchemy.t(:apply), class: 'create-link button', data: { link_type: 'product' } %>
|
27
|
+
</div>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<%= render "product_link_script" %>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<script>
|
2
|
+
$("#overlay_tabs").on("SelectLinkTab.Alchemy", function(event, data) {
|
3
|
+
$("#product_link").select2("val", data.link.attr("href"))
|
4
|
+
})
|
5
|
+
$("#product_link").alchemyProductSelect({
|
6
|
+
placeholder: "<%= Alchemy.t(:search_product, scope: "solidus") %>",
|
7
|
+
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
8
|
+
baseUrl: "<%= spree.api_products_path %>",
|
9
|
+
formatResultObject(product) {
|
10
|
+
return {
|
11
|
+
id: Spree.mountedAt() + "products/"+ product.slug,
|
12
|
+
text: product.name,
|
13
|
+
}
|
14
|
+
},
|
15
|
+
initSelection($element, callback) {
|
16
|
+
var query = $element.val().replace(Spree.mountedAt() + "products/", "")
|
17
|
+
$.ajax({
|
18
|
+
url: "<%= spree.api_products_path %>",
|
19
|
+
data: {
|
20
|
+
q: { slug_eq: query },
|
21
|
+
page: 1,
|
22
|
+
per_page: 1
|
23
|
+
},
|
24
|
+
headers: {
|
25
|
+
Authorization: "Bearer <%= current_alchemy_user.spree_api_key %>"
|
26
|
+
}
|
27
|
+
}).done(function(data) {
|
28
|
+
var product = data.products[0]
|
29
|
+
if (product) {
|
30
|
+
callback({
|
31
|
+
id: Spree.mountedAt() + "products/"+ product.slug,
|
32
|
+
text: product.name
|
33
|
+
})
|
34
|
+
$("#overlay_tabs").tabs("option", "active",
|
35
|
+
$("#overlay_tabs > div").index($("#overlay_tab_product_link"))
|
36
|
+
)
|
37
|
+
}
|
38
|
+
})
|
39
|
+
},
|
40
|
+
})
|
41
|
+
</script>
|
@@ -1,17 +1,17 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "rails/generators"
|
2
|
+
require "alchemy/version"
|
3
3
|
|
4
4
|
if Alchemy.gem_version >= Gem::Version.new("5.0.0.a")
|
5
|
-
require
|
5
|
+
require "generators/alchemy/install/install_generator"
|
6
6
|
else
|
7
|
-
require
|
7
|
+
require "rails/generators/alchemy/install/install_generator"
|
8
8
|
end
|
9
9
|
|
10
|
-
require
|
11
|
-
require
|
10
|
+
require "generators/spree/custom_user/custom_user_generator"
|
11
|
+
require "solidus_support"
|
12
12
|
|
13
13
|
begin
|
14
|
-
require
|
14
|
+
require "generators/alchemy/devise/install/install_generator"
|
15
15
|
rescue LoadError
|
16
16
|
end
|
17
17
|
|
@@ -21,46 +21,81 @@ module Alchemy
|
|
21
21
|
SPREE_MOUNT_REGEXP = /mount\sSpree::Core::Engine.*$/
|
22
22
|
desc "Installs Alchemy Solidus into your App."
|
23
23
|
|
24
|
-
class_option :skip_alchemy_installer,
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
24
|
+
class_option :skip_alchemy_installer,
|
25
|
+
default: false,
|
26
|
+
type: :boolean,
|
27
|
+
desc:
|
28
|
+
"Set true if you don't want to run the Alchemy installer"
|
29
|
+
class_option :skip_alchemy_devise_installer,
|
30
|
+
default: false,
|
31
|
+
type: :boolean,
|
32
|
+
desc:
|
33
|
+
"Set true if you don't want to run the Alchemy Devise installer. NOTE: Automatically skipped if Alchemy::Devise is not available."
|
34
|
+
class_option :skip_spree_custom_user_generator,
|
35
|
+
default: false,
|
36
|
+
type: :boolean,
|
37
|
+
desc:
|
38
|
+
"Set true if you don't want to run the Solidus custom user generator. NOTE: Automatically skipped if Alchemy::Devise is not available."
|
39
|
+
class_option :skip_alchemy_user_generator,
|
40
|
+
default: false,
|
41
|
+
type: :boolean,
|
42
|
+
desc:
|
43
|
+
"Set true if you don't want to generate an admin user. NOTE: Automatically skipped if Alchemy::Devise is not available."
|
44
|
+
class_option :auto_accept,
|
45
|
+
default: false,
|
46
|
+
type: :boolean,
|
47
|
+
desc: "Set true if run from a automated script (ie. on a CI)"
|
48
|
+
|
49
|
+
source_root File.expand_path("files", __dir__)
|
36
50
|
|
37
51
|
def run_alchemy_installer
|
38
52
|
unless options[:skip_alchemy_installer]
|
39
|
-
arguments =
|
53
|
+
arguments =
|
54
|
+
(
|
55
|
+
if options[:auto_accept]
|
56
|
+
%w[--skip-demo-files --skip --auto-accept]
|
57
|
+
else
|
58
|
+
[]
|
59
|
+
end
|
60
|
+
)
|
40
61
|
Alchemy::Generators::InstallGenerator.start(arguments)
|
41
|
-
rake(
|
42
|
-
rake(
|
62
|
+
rake("railties:install:migrations", abort_on_failure: true)
|
63
|
+
rake("db:migrate", abort_on_failure: true)
|
43
64
|
end
|
44
65
|
end
|
45
66
|
|
46
67
|
def run_alchemy_devise_installer
|
47
68
|
if alchemy_devise_present? && !options[:skip_alchemy_devise_installer]
|
48
|
-
arguments = options[:auto_accept] ? [
|
69
|
+
arguments = options[:auto_accept] ? ["--force"] : []
|
49
70
|
Alchemy::Devise::Generators::InstallGenerator.start(arguments)
|
50
71
|
end
|
51
72
|
end
|
52
73
|
|
53
74
|
def run_spree_custom_user_generator
|
54
|
-
if alchemy_devise_present? &&
|
55
|
-
|
75
|
+
if alchemy_devise_present? &&
|
76
|
+
!options[:skip_spree_custom_user_generator]
|
77
|
+
arguments =
|
78
|
+
(
|
79
|
+
if options[:auto_accept]
|
80
|
+
%w[Alchemy::User --force]
|
81
|
+
else
|
82
|
+
["Alchemy::User"]
|
83
|
+
end
|
84
|
+
)
|
56
85
|
Spree::CustomUserGenerator.start(arguments)
|
57
|
-
gsub_file
|
58
|
-
|
86
|
+
gsub_file "lib/spree/authentication_helpers.rb",
|
87
|
+
/main_app\./,
|
88
|
+
"Alchemy."
|
89
|
+
rake("db:migrate", abort_on_failure: true)
|
59
90
|
end
|
60
91
|
end
|
61
92
|
|
62
93
|
def inject_admin_tab
|
63
|
-
inject_into_file
|
94
|
+
inject_into_file "config/initializers/spree.rb",
|
95
|
+
{
|
96
|
+
after:
|
97
|
+
"Spree::Backend::Config.configure do |config|\n"
|
98
|
+
} do
|
64
99
|
<<~ADMIN_TAB
|
65
100
|
\ # AlchemyCMS admin tabs
|
66
101
|
\ config.menu_items << config.class::MenuItem.new(
|
@@ -77,64 +112,74 @@ module Alchemy
|
|
77
112
|
end
|
78
113
|
|
79
114
|
def create_admin_user
|
80
|
-
if alchemy_devise_present? && !options[:skip_alchemy_user_generator] &&
|
81
|
-
|
82
|
-
|
83
|
-
|
115
|
+
if alchemy_devise_present? && !options[:skip_alchemy_user_generator] &&
|
116
|
+
Alchemy::User.count.zero?
|
117
|
+
login = ENV.fetch("ALCHEMY_ADMIN_USER_LOGIN", "admin")
|
118
|
+
email = ENV.fetch("ALCHEMY_ADMIN_USER_EMAIL", "admin@example.com")
|
119
|
+
password = ENV.fetch("ALCHEMY_ADMIN_USER_PASSWORD", "test1234")
|
84
120
|
unless options[:auto_accept]
|
85
|
-
login =
|
121
|
+
login =
|
122
|
+
ask("\nEnter the username for the admin user", default: login)
|
86
123
|
email = ask("Enter the email for the admin user", default: email)
|
87
|
-
password =
|
124
|
+
password =
|
125
|
+
ask("Enter the password for the admin user", default: password)
|
88
126
|
end
|
89
127
|
|
90
128
|
# This is a bit strange, but without the double save this fails with a failed validation.
|
91
|
-
Alchemy::User
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
user
|
100
|
-
|
129
|
+
Alchemy::User
|
130
|
+
.create!(
|
131
|
+
login: login,
|
132
|
+
email: email,
|
133
|
+
password: password,
|
134
|
+
password_confirmation: password,
|
135
|
+
alchemy_roles: "admin"
|
136
|
+
)
|
137
|
+
.tap do |user|
|
138
|
+
user.spree_roles = [Spree::Role.find_or_create_by!(name: "admin")]
|
139
|
+
user.save!
|
140
|
+
end
|
101
141
|
end
|
102
142
|
end
|
103
143
|
|
104
144
|
def inject_routes
|
105
|
-
routes_file_path = Rails.root.join(
|
106
|
-
mountpoint =
|
145
|
+
routes_file_path = Rails.root.join("config", "routes.rb")
|
146
|
+
mountpoint = "/"
|
107
147
|
unless options[:auto_accept]
|
108
|
-
mountpoint =
|
148
|
+
mountpoint =
|
149
|
+
ask(
|
150
|
+
"\nAt which path do you want to mount AlchemyCMS at?",
|
151
|
+
default: mountpoint
|
152
|
+
)
|
109
153
|
end
|
110
154
|
if File.read(routes_file_path).match SPREE_MOUNT_REGEXP
|
111
155
|
sentinel = SPREE_MOUNT_REGEXP
|
112
156
|
else
|
113
157
|
sentinel = "Rails.application.routes.draw do\n"
|
114
158
|
end
|
115
|
-
inject_into_file routes_file_path, {after: sentinel} do
|
116
|
-
"\n mount Alchemy::Engine, at: '/#{mountpoint.chomp(
|
159
|
+
inject_into_file routes_file_path, { after: sentinel } do
|
160
|
+
"\n mount Alchemy::Engine, at: '/#{mountpoint.chomp("/")}'\n"
|
117
161
|
end
|
118
162
|
end
|
119
163
|
|
120
164
|
def set_root_route
|
121
|
-
routes_file_path = Rails.root.join(
|
122
|
-
if options[:auto_accept] ||
|
165
|
+
routes_file_path = Rails.root.join("config", "routes.rb")
|
166
|
+
if options[:auto_accept] ||
|
167
|
+
yes?("\nDo you want Alchemy to handle the root route '/'? (y/n)")
|
123
168
|
sentinel = "Rails.application.routes.draw do\n"
|
124
|
-
inject_into_file routes_file_path, {after: sentinel} do
|
169
|
+
inject_into_file routes_file_path, { after: sentinel } do
|
125
170
|
<<~ROOT_ROUTE
|
126
171
|
\ # Let AlchemyCMS handle the root route
|
127
172
|
\ root to: 'alchemy/pages#index'
|
128
173
|
ROOT_ROUTE
|
129
174
|
end
|
130
|
-
copy_file(
|
131
|
-
rake(
|
175
|
+
copy_file("db/seeds/alchemy/pages.yml")
|
176
|
+
rake("alchemy:db:seed", abort_on_failure: true)
|
132
177
|
end
|
133
178
|
end
|
134
179
|
|
135
180
|
def append_assets
|
136
181
|
append_file "vendor/assets/javascripts/alchemy/admin/all.js",
|
137
|
-
|
182
|
+
"//= require alchemy/solidus/admin.js"
|
138
183
|
end
|
139
184
|
|
140
185
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-solidus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.0.b
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 7.0.0.b
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: solidus_core
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: 3.0.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '4.
|
42
|
+
version: '4.1'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: 3.0.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '4.
|
52
|
+
version: '4.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: solidus_backend
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
version: 3.0.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '4.
|
62
|
+
version: '4.1'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
version: 3.0.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '4.
|
72
|
+
version: '4.1'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: solidus_support
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,14 +104,14 @@ dependencies:
|
|
104
104
|
requirements:
|
105
105
|
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
107
|
+
version: '6.0'
|
108
108
|
type: :development
|
109
109
|
prerelease: false
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
112
|
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
114
|
+
version: '6.0'
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: shoulda-matchers
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,14 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: '
|
135
|
+
version: '3.0'
|
136
136
|
type: :development
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - "~>"
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: '
|
142
|
+
version: '3.0'
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: capybara-screenshot
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,6 +196,54 @@ dependencies:
|
|
196
196
|
- - ">="
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: '0'
|
199
|
+
- !ruby/object:Gem::Dependency
|
200
|
+
name: selenium-webdriver
|
201
|
+
requirement: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - "~>"
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '4.8'
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 4.8.3
|
209
|
+
type: :development
|
210
|
+
prerelease: false
|
211
|
+
version_requirements: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '4.8'
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 4.8.3
|
219
|
+
- !ruby/object:Gem::Dependency
|
220
|
+
name: puma
|
221
|
+
requirement: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - "~>"
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '6.0'
|
226
|
+
type: :development
|
227
|
+
prerelease: false
|
228
|
+
version_requirements: !ruby/object:Gem::Requirement
|
229
|
+
requirements:
|
230
|
+
- - "~>"
|
231
|
+
- !ruby/object:Gem::Version
|
232
|
+
version: '6.0'
|
233
|
+
- !ruby/object:Gem::Dependency
|
234
|
+
name: webdrivers
|
235
|
+
requirement: !ruby/object:Gem::Requirement
|
236
|
+
requirements:
|
237
|
+
- - "~>"
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
version: '5.0'
|
240
|
+
type: :development
|
241
|
+
prerelease: false
|
242
|
+
version_requirements: !ruby/object:Gem::Requirement
|
243
|
+
requirements:
|
244
|
+
- - "~>"
|
245
|
+
- !ruby/object:Gem::Version
|
246
|
+
version: '5.0'
|
199
247
|
description: A AlchemyCMS and Solidus integration
|
200
248
|
email:
|
201
249
|
- thomas@vondeyen.com
|
@@ -211,18 +259,16 @@ files:
|
|
211
259
|
- app/assets/javascripts/alchemy/solidus/admin/select2_config.js
|
212
260
|
- app/assets/javascripts/alchemy/solidus/admin/taxon_select.js
|
213
261
|
- app/assets/javascripts/alchemy/solidus/admin/variant_select.js
|
214
|
-
- app/
|
215
|
-
- app/
|
216
|
-
- app/
|
262
|
+
- app/components/alchemy/ingredients/spree_product_view.rb
|
263
|
+
- app/components/alchemy/ingredients/spree_taxon_view.rb
|
264
|
+
- app/components/alchemy/ingredients/spree_variant_view.rb
|
217
265
|
- app/models/alchemy/ingredients/spree_product.rb
|
218
266
|
- app/models/alchemy/ingredients/spree_taxon.rb
|
219
267
|
- app/models/alchemy/ingredients/spree_variant.rb
|
220
|
-
- app/
|
221
|
-
- app/
|
222
|
-
- app/views/alchemy/
|
223
|
-
- app/views/alchemy/
|
224
|
-
- app/views/alchemy/essences/_essence_spree_variant_editor.html.erb
|
225
|
-
- app/views/alchemy/essences/_essence_spree_variant_view.html.erb
|
268
|
+
- app/overrides/alchemy/admin/pages/link/product_link.html.erb.deface
|
269
|
+
- app/overrides/alchemy/admin/pages/link/product_link_tab.html.erb.deface
|
270
|
+
- app/views/alchemy/admin/pages/_product_link.html.erb
|
271
|
+
- app/views/alchemy/admin/pages/_product_link_script.html.erb
|
226
272
|
- app/views/alchemy/ingredients/_spree_product_editor.html.erb
|
227
273
|
- app/views/alchemy/ingredients/_spree_product_view.html.erb
|
228
274
|
- app/views/alchemy/ingredients/_spree_taxon_editor.html.erb
|
@@ -268,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
314
|
- !ruby/object:Gem::Version
|
269
315
|
version: '0'
|
270
316
|
requirements: []
|
271
|
-
rubygems_version: 3.4.
|
317
|
+
rubygems_version: 3.4.12
|
272
318
|
signing_key:
|
273
319
|
specification_version: 4
|
274
320
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Alchemy
|
4
|
-
class EssenceSpreeProduct < ActiveRecord::Base
|
5
|
-
PRODUCT_ID = /\A\d+\z/
|
6
|
-
|
7
|
-
belongs_to :product,
|
8
|
-
class_name: "Spree::Product",
|
9
|
-
optional: true,
|
10
|
-
foreign_key: "spree_product_id"
|
11
|
-
|
12
|
-
acts_as_essence(ingredient_column: :product)
|
13
|
-
|
14
|
-
def ingredient=(product_or_id)
|
15
|
-
case product_or_id
|
16
|
-
when PRODUCT_ID, ""
|
17
|
-
self.spree_product_id = product_or_id
|
18
|
-
when Spree::Product
|
19
|
-
self.product = product_or_id
|
20
|
-
else
|
21
|
-
super
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def preview_text(_maxlength)
|
26
|
-
return unless product
|
27
|
-
product.name
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Alchemy
|
4
|
-
class EssenceSpreeTaxon < ActiveRecord::Base
|
5
|
-
TAXON_ID = /\A\d+\z/
|
6
|
-
|
7
|
-
belongs_to :taxon,
|
8
|
-
class_name: "Spree::Taxon",
|
9
|
-
optional: true,
|
10
|
-
foreign_key: "taxon_id"
|
11
|
-
|
12
|
-
acts_as_essence(ingredient_column: :taxon)
|
13
|
-
|
14
|
-
def ingredient=(taxon_or_id)
|
15
|
-
case taxon_or_id
|
16
|
-
when TAXON_ID, ""
|
17
|
-
self.taxon_id = taxon_or_id
|
18
|
-
when Spree::Taxon
|
19
|
-
self.taxon = taxon_or_id
|
20
|
-
else
|
21
|
-
super
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def preview_text(_maxlength)
|
26
|
-
return unless taxon
|
27
|
-
taxon.name
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Alchemy
|
4
|
-
class EssenceSpreeVariant < ActiveRecord::Base
|
5
|
-
VARIANT_ID = /\A\d+\z/
|
6
|
-
|
7
|
-
belongs_to :variant,
|
8
|
-
class_name: "Spree::Variant",
|
9
|
-
optional: true
|
10
|
-
|
11
|
-
acts_as_essence(ingredient_column: :variant)
|
12
|
-
|
13
|
-
def ingredient=(variant_or_id)
|
14
|
-
case variant_or_id
|
15
|
-
when VARIANT_ID, ""
|
16
|
-
self.variant_id = variant_or_id
|
17
|
-
when Spree::Variant
|
18
|
-
self.variant = variant_or_id
|
19
|
-
else
|
20
|
-
super
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def preview_text(_maxlength)
|
25
|
-
return unless variant
|
26
|
-
variant.descriptive_name
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<% content ||= local_assigns[:content] || local_assigns[:essence_spree_product_editor] %>
|
2
|
-
|
3
|
-
<div class="content_editor essence_spree_product" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
|
4
|
-
<%= content_label(content) %>
|
5
|
-
<%= text_field_tag(
|
6
|
-
content.form_field_name,
|
7
|
-
content.essence.spree_product_id,
|
8
|
-
id: content.form_field_id,
|
9
|
-
class: 'alchemy_selectbox full_width'
|
10
|
-
) %>
|
11
|
-
</div>
|
12
|
-
|
13
|
-
<script>
|
14
|
-
$('#<%= content.form_field_id %>').alchemyProductSelect({
|
15
|
-
placeholder: "<%= Alchemy.t(:search_product, scope: 'solidus') %>",
|
16
|
-
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
17
|
-
baseUrl: "<%= spree.api_products_path %>",
|
18
|
-
query_params: <%== content.settings[:query_params].to_json %>,
|
19
|
-
<% if content.essence.product %>
|
20
|
-
initialSelection: {
|
21
|
-
id: <%= content.essence.spree_product_id %>,
|
22
|
-
text: "<%= content.essence.product.name %>"
|
23
|
-
}
|
24
|
-
<% end %>
|
25
|
-
})
|
26
|
-
</script>
|
File without changes
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<% content ||= local_assigns[:content] || local_assigns[:essence_spree_taxon_editor] %>
|
2
|
-
|
3
|
-
<div class="content_editor essence_spree_taxon" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
|
4
|
-
<%= content_label(content) %>
|
5
|
-
<%= text_field_tag(
|
6
|
-
content.form_field_name,
|
7
|
-
content.essence.taxon_id,
|
8
|
-
id: content.form_field_id,
|
9
|
-
class: 'alchemy_selectbox full_width'
|
10
|
-
) %>
|
11
|
-
</div>
|
12
|
-
|
13
|
-
<script>
|
14
|
-
$('#<%= content.form_field_id %>').alchemyTaxonSelect({
|
15
|
-
placeholder: "<%= Alchemy.t(:search_taxon, scope: 'solidus') %>",
|
16
|
-
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
17
|
-
baseUrl: "<%= spree.api_taxons_path %>",
|
18
|
-
query_params: <%== content.settings[:query_params].to_json %>,
|
19
|
-
<% if content.essence.taxon %>
|
20
|
-
initialSelection: {
|
21
|
-
id: <%= content.essence.taxon_id %>,
|
22
|
-
text: "<%= content.essence.taxon.pretty_name %>"
|
23
|
-
}
|
24
|
-
<% end %>
|
25
|
-
})
|
26
|
-
</script>
|
File without changes
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<% content ||= local_assigns[:content] || local_assigns[:essence_spree_variant_editor] %>
|
2
|
-
|
3
|
-
<div class="content_editor essence_spree_variant" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
|
4
|
-
<%= content_label(content) %>
|
5
|
-
<%= text_field_tag(
|
6
|
-
content.form_field_name,
|
7
|
-
content.essence.variant_id,
|
8
|
-
id: content.form_field_id,
|
9
|
-
class: 'alchemy_selectbox full_width'
|
10
|
-
) %>
|
11
|
-
</div>
|
12
|
-
|
13
|
-
<script>
|
14
|
-
$('#<%= content.form_field_id %>').alchemyVariantSelect({
|
15
|
-
placeholder: "<%= Alchemy.t(:search_variant, scope: 'solidus') %>",
|
16
|
-
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
17
|
-
baseUrl: "<%= spree.api_variants_path %>",
|
18
|
-
query_params: <%== content.settings[:query_params].to_json %>,
|
19
|
-
<% if content.essence.variant %>
|
20
|
-
initialSelection: {
|
21
|
-
id: <%= content.essence.variant_id %>,
|
22
|
-
text: "<%= content.essence.variant.name %>"
|
23
|
-
}
|
24
|
-
<% end %>
|
25
|
-
})
|
26
|
-
</script>
|
File without changes
|