alchemy-solidus 5.0.0 → 6.0.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/Rakefile +17 -6
- 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/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/config/locales/alchemy_solidus_en.yml +3 -0
- data/lib/alchemy/solidus/version.rb +1 -1
- data/lib/generators/alchemy/solidus/install/install_generator.rb +100 -55
- metadata +63 -20
- 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: 16a15dfe376f96cd10368b80600ecd90db0883f2c49b82d34494d0d7cbd11e2d
|
4
|
+
data.tar.gz: 58eb94228f3a082ca8f7e0b38132c894edccdb4a64e352efe7968516fc43dd99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef6b3b8d01fff1ee7fbfb25fc9813bbffc192af8481e21e4f4b49ba73b9f14509d50de621947a925a06a6a51df5cd1eeb5c3a765942fd4f78ac3d72e17b722f5
|
7
|
+
data.tar.gz: b1fbae3de6f3d2aef1b2cca13e95298e845baac85fb60cf3c4db123b63ff6ee9b41c5f9a2f70619a556d11b38e01fb84ce52c6e698d275f7b8a38345f9f47418
|
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
19
|
solidus_version = ENV.fetch("SOLIDUS_VERSION", "3.2")
|
20
|
-
solidus_32_install_options =
|
21
|
-
|
22
|
-
|
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.0
|
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-04-26 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.a
|
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.a
|
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
|
@@ -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,13 @@ 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/models/alchemy/essence_spree_product.rb
|
215
|
-
- app/models/alchemy/essence_spree_taxon.rb
|
216
|
-
- app/models/alchemy/essence_spree_variant.rb
|
217
262
|
- app/models/alchemy/ingredients/spree_product.rb
|
218
263
|
- app/models/alchemy/ingredients/spree_taxon.rb
|
219
264
|
- 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
|
265
|
+
- app/overrides/alchemy/admin/pages/link/product_link.html.erb.deface
|
266
|
+
- app/overrides/alchemy/admin/pages/link/product_link_tab.html.erb.deface
|
267
|
+
- app/views/alchemy/admin/pages/_product_link.html.erb
|
268
|
+
- app/views/alchemy/admin/pages/_product_link_script.html.erb
|
226
269
|
- app/views/alchemy/ingredients/_spree_product_editor.html.erb
|
227
270
|
- app/views/alchemy/ingredients/_spree_product_view.html.erb
|
228
271
|
- app/views/alchemy/ingredients/_spree_taxon_editor.html.erb
|
@@ -268,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
311
|
- !ruby/object:Gem::Version
|
269
312
|
version: '0'
|
270
313
|
requirements: []
|
271
|
-
rubygems_version: 3.
|
314
|
+
rubygems_version: 3.3.26
|
272
315
|
signing_key:
|
273
316
|
specification_version: 4
|
274
317
|
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
|