solidus_backend 4.4.2 → 4.5.1
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/app/assets/javascripts/spree/backend/taxon_autocomplete.js +49 -19
- data/app/controllers/spree/admin/base_controller.rb +8 -0
- data/app/views/spree/admin/products/_form.html.erb +25 -0
- data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
- data/app/views/spree/admin/variants/_form.html.erb +17 -0
- data/lib/spree/backend_configuration.rb +7 -0
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7130001c5b3ccbd6cec823fc5a7115e3d8dda61d83bc0aae2ba85ced3d98272a
|
4
|
+
data.tar.gz: e5c0d4d67bb04cba1b3155ba70fce9fe213e0a61f20e8839111e6cff3a7c1809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09017549f00cae27ee5c011f7d148a77cf6d470877f34e99aad44527e2ac01788f91dd258972b4a75bfa2980e0ac78246a884b14916e7f28c6d0ef86c03135f2'
|
7
|
+
data.tar.gz: 64884cb9999e915fa84768ab8bba317470e976085432a45f9eb444647f109cb90b2eb1b9afaafa201a766db6a0f71014f3c6ad8272f7afbfa3dc6fbf2d4cc4ba
|
@@ -1,25 +1,49 @@
|
|
1
|
-
$.fn.taxonAutocomplete = function () {
|
1
|
+
$.fn.taxonAutocomplete = function (options) {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
+
var defaultOptions = {
|
5
|
+
multiple: true,
|
6
|
+
placeholder: Spree.translations.taxon_placeholder
|
7
|
+
};
|
8
|
+
|
9
|
+
options = $.extend({}, defaultOptions, options);
|
10
|
+
|
4
11
|
this.select2({
|
5
|
-
placeholder:
|
6
|
-
multiple:
|
12
|
+
placeholder: options.placeholder,
|
13
|
+
multiple: options.multiple,
|
7
14
|
initSelection: function (element, callback) {
|
8
|
-
var ids = element.val()
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
var ids = element.val();
|
16
|
+
|
17
|
+
if (options.multiple) {
|
18
|
+
var count = ids.split(",").length;
|
19
|
+
|
20
|
+
Spree.ajax({
|
21
|
+
type: "GET",
|
22
|
+
url: Spree.pathFor('api/taxons'),
|
23
|
+
data: {
|
24
|
+
ids: ids,
|
25
|
+
per_page: count,
|
26
|
+
without_children: true
|
27
|
+
},
|
28
|
+
success: function (data) {
|
29
|
+
callback(data['taxons']);
|
30
|
+
}
|
31
|
+
});
|
32
|
+
} else {
|
33
|
+
|
34
|
+
Spree.ajax({
|
35
|
+
type: "GET",
|
36
|
+
url: Spree.pathFor('api/taxons'),
|
37
|
+
data: {
|
38
|
+
ids: ids,
|
39
|
+
per_page: 1,
|
40
|
+
without_children: true
|
41
|
+
},
|
42
|
+
success: function (data) {
|
43
|
+
callback(data['taxons'][0]);
|
44
|
+
}
|
45
|
+
});
|
46
|
+
}
|
23
47
|
},
|
24
48
|
ajax: {
|
25
49
|
url: Spree.pathFor('api/taxons'),
|
@@ -53,5 +77,11 @@ $.fn.taxonAutocomplete = function () {
|
|
53
77
|
};
|
54
78
|
|
55
79
|
Spree.ready(function () {
|
56
|
-
$('#product_taxon_ids, .taxon_picker').taxonAutocomplete(
|
80
|
+
$('#product_taxon_ids, .taxon_picker').taxonAutocomplete({
|
81
|
+
multiple: true,
|
82
|
+
});
|
83
|
+
|
84
|
+
$('#product_primary_taxon_id').taxonAutocomplete({
|
85
|
+
multiple: false,
|
86
|
+
});
|
57
87
|
});
|
@@ -68,6 +68,14 @@ module Spree
|
|
68
68
|
redirect_to redirect_url
|
69
69
|
nil
|
70
70
|
end
|
71
|
+
|
72
|
+
def handle_unauthorized_access
|
73
|
+
if unauthorized_redirect
|
74
|
+
instance_exec(&unauthorized_redirect)
|
75
|
+
else
|
76
|
+
Spree::Backend::Config.unauthorized_redirect_handler_class.new(self).call
|
77
|
+
end
|
78
|
+
end
|
71
79
|
end
|
72
80
|
end
|
73
81
|
end
|
@@ -36,6 +36,13 @@
|
|
36
36
|
<% end %>
|
37
37
|
</div>
|
38
38
|
|
39
|
+
<div data-hook="admin_product_form_primary_taxons">
|
40
|
+
<%= f.field_container :primary_taxon do %>
|
41
|
+
<%= f.label :primary_taxon_id %><br>
|
42
|
+
<%= f.hidden_field :primary_taxon_id, value: @product.primary_taxon_id %>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
45
|
+
|
39
46
|
<div data-hook="admin_product_form_option_types">
|
40
47
|
<%= f.field_container :option_types do %>
|
41
48
|
<%= f.label :option_type_ids, plural_resource_name(Spree::OptionType) %>
|
@@ -172,6 +179,24 @@
|
|
172
179
|
</div>
|
173
180
|
</div>
|
174
181
|
<% else %>
|
182
|
+
<div data-hook="admin_product_form_gtin">
|
183
|
+
<%= f.field_container :gtin do %>
|
184
|
+
<%= f.label :gtin %>
|
185
|
+
<%= f.text_field :gtin %>
|
186
|
+
<% end %>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div data-hook="admin_product_form_condition">
|
190
|
+
<%= f.field_container :condition do %>
|
191
|
+
<%= f.label :condition %>
|
192
|
+
<%= f.select :condition,
|
193
|
+
Spree::Variant.conditions.map { |key, value| [t("spree.condition.#{key}"), value] },
|
194
|
+
{ include_blank: t('spree.unset') },
|
195
|
+
class: 'custom-select'
|
196
|
+
%>
|
197
|
+
<% end %>
|
198
|
+
</div>
|
199
|
+
|
175
200
|
<div id="shipping_specs" class="row">
|
176
201
|
<% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
|
177
202
|
<div id="shipping_specs_<%= field %>_field" class="col-6">
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<fieldset class="no-border-bottom">
|
25
25
|
<legend><%= t('.address') %></legend>
|
26
26
|
|
27
|
-
<%= f.field_container :
|
27
|
+
<%= f.field_container :address1 do %>
|
28
28
|
<%= f.label :address1 %>
|
29
29
|
<%= f.text_field :address1, class: 'fullwidth' %>
|
30
30
|
<% end %>
|
@@ -7,6 +7,23 @@
|
|
7
7
|
<%= f.text_field :sku, class: 'fullwidth' %>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
|
+
|
11
|
+
<div class="col-3">
|
12
|
+
<div class="field" data-hook="gtin">
|
13
|
+
<%= f.label :gtin %>
|
14
|
+
<%= f.text_field :gtin, class: 'fullwidth' %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="col-3">
|
19
|
+
<div class="field" data-hook="condition">
|
20
|
+
<%= f.label :condition %>
|
21
|
+
<%= f.select :condition,
|
22
|
+
Spree::Variant.conditions.map { |key, value| [t("spree.condition.#{key}"), value] },
|
23
|
+
{ include_blank: t('spree.unset') },
|
24
|
+
class: 'custom-select fullwidth' %>
|
25
|
+
</div>
|
26
|
+
</div>
|
10
27
|
<div class="col-3">
|
11
28
|
<div class="field checkbox" data-hook="track_inventory">
|
12
29
|
<label>
|
@@ -140,6 +140,13 @@ module Spree
|
|
140
140
|
autoload :STOCK_TABS, 'spree/backend_configuration/deprecated_tab_constants'
|
141
141
|
autoload :USER_TABS, 'spree/backend_configuration/deprecated_tab_constants'
|
142
142
|
|
143
|
+
# By default, this is set to +Spree::UnauthorizedRedirectHandler+. If you need your admin to behave
|
144
|
+
# differently when a user is unauthorized, you can create your own class that respects the same interface.
|
145
|
+
#
|
146
|
+
# @!attribute [rw] unauthorized_redirect_handler_class
|
147
|
+
# @return [Class] The class that will handle unauthorized access errors.
|
148
|
+
class_name_attribute :unauthorized_redirect_handler_class, default: "Spree::UnauthorizedRedirectHandler"
|
149
|
+
|
143
150
|
# Items can be added to the menu by using code like the following:
|
144
151
|
#
|
145
152
|
# Spree::Backend::Config.configure do |config|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: solidus_api
|
@@ -16,28 +15,28 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - '='
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
18
|
+
version: 4.5.1
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - '='
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
25
|
+
version: 4.5.1
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: solidus_core
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - '='
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
32
|
+
version: 4.5.1
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - '='
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
39
|
+
version: 4.5.1
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: font-awesome-rails
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -844,7 +843,6 @@ licenses:
|
|
844
843
|
- BSD-3-Clause
|
845
844
|
metadata:
|
846
845
|
rubygems_mfa_required: 'true'
|
847
|
-
post_install_message:
|
848
846
|
rdoc_options: []
|
849
847
|
require_paths:
|
850
848
|
- lib
|
@@ -859,8 +857,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
859
857
|
- !ruby/object:Gem::Version
|
860
858
|
version: 1.8.23
|
861
859
|
requirements: []
|
862
|
-
rubygems_version: 3.5
|
863
|
-
signing_key:
|
860
|
+
rubygems_version: 3.6.5
|
864
861
|
specification_version: 4
|
865
862
|
summary: Admin interface for the Solidus e-commerce framework.
|
866
863
|
test_files: []
|