spree_admin 5.4.0.beta2 → 5.4.0.beta3
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/controllers/spree/admin/markets_controller.rb +14 -0
- data/app/helpers/spree/admin/products_helper.rb +2 -2
- data/app/subscribers/spree/admin/import_row_subscriber.rb +1 -1
- data/app/subscribers/spree/admin/import_subscriber.rb +1 -1
- data/app/views/spree/admin/products/_table_filter_dropdown.html.erb +6 -6
- data/config/initializers/spree_admin_tables.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e25435ab28276f0ca9a78db5d61f4b5485be27fb668ee9c1c381db48812445e
|
|
4
|
+
data.tar.gz: cc103dc8524c6a0575e367a427e88037647cc22caa9dd5117a0091715df480d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b5b4a0bd4ee889940ca9826c9f6e2db5337bf1215588e543343be9fab77454ad3e9254f5b903eefcc485f6ef30673d38171fec315f3b3d5a16b463d68a42559
|
|
7
|
+
data.tar.gz: 5f67328def69057604315c1c79a3bcaae424ce369d98741b7521b1fe98f91f552aff41883534b5df81914d73d6a3d5985430551c8a6392e8caa537411778b44e
|
|
@@ -10,6 +10,20 @@ module Spree
|
|
|
10
10
|
|
|
11
11
|
def load_data
|
|
12
12
|
@countries = current_store.countries_with_shipping_coverage
|
|
13
|
+
|
|
14
|
+
# Exclude countries already assigned to other markets in the store
|
|
15
|
+
if @object&.persisted?
|
|
16
|
+
taken_country_ids = Spree::MarketCountry.joins(:market)
|
|
17
|
+
.where(spree_markets: { store_id: current_store.id, deleted_at: nil })
|
|
18
|
+
.where.not(market_id: @object.id)
|
|
19
|
+
.pluck(:country_id)
|
|
20
|
+
else
|
|
21
|
+
taken_country_ids = Spree::MarketCountry.joins(:market)
|
|
22
|
+
.where(spree_markets: { store_id: current_store.id, deleted_at: nil })
|
|
23
|
+
.pluck(:country_id)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
@countries = @countries.where.not(id: taken_country_ids) if taken_country_ids.any?
|
|
13
27
|
end
|
|
14
28
|
|
|
15
29
|
def permitted_resource_params
|
|
@@ -90,9 +90,9 @@ module Spree
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def product_filter_stock_dropdown_value
|
|
93
|
-
if params.dig(:q, :
|
|
93
|
+
if params.dig(:q, :in_stock) == '1'
|
|
94
94
|
Spree.t('admin.products.in_stock')
|
|
95
|
-
elsif params.dig(:q, :
|
|
95
|
+
elsif params.dig(:q, :out_of_stock) == '1'
|
|
96
96
|
Spree.t('admin.products.out_of_stock')
|
|
97
97
|
else
|
|
98
98
|
Spree.t('admin.products.any_stock')
|
|
@@ -21,7 +21,7 @@ module Spree
|
|
|
21
21
|
import_row_id = event.payload['id']
|
|
22
22
|
return unless import_row_id
|
|
23
23
|
|
|
24
|
-
import_row = Spree::ImportRow.
|
|
24
|
+
import_row = Spree::ImportRow.find_by_prefix_id(import_row_id)
|
|
25
25
|
return unless import_row
|
|
26
26
|
|
|
27
27
|
add_row_to_import_view(import_row)
|
|
@@ -19,7 +19,7 @@ module Spree
|
|
|
19
19
|
import_id = event.payload['id']
|
|
20
20
|
return unless import_id
|
|
21
21
|
|
|
22
|
-
import = Spree::Import.
|
|
22
|
+
import = Spree::Import.find_by_prefix_id(import_id)
|
|
23
23
|
return unless import
|
|
24
24
|
return unless import.respond_to?(:broadcast_update_to)
|
|
25
25
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<%= dropdown_menu do %>
|
|
17
17
|
<h6 class="dropdown-header"><%= Spree.t('admin.products.by_status') %>:</h6>
|
|
18
18
|
|
|
19
|
-
<%= active_link_to Spree.t('admin.products.all_statuses'), params.to_unsafe_h.deep_merge({page: nil, q: {status_eq: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[status_eq
|
|
19
|
+
<%= active_link_to Spree.t('admin.products.all_statuses'), params.to_unsafe_h.deep_merge({page: nil, q: {status_eq: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[status_eq in_stock out_of_stock] ).all?(&:blank?) %>
|
|
20
20
|
<%= link_to Spree.t('admin.products.active'),
|
|
21
21
|
params.to_unsafe_h.deep_merge({page: nil, q: {status_eq: :active}}),
|
|
22
22
|
class: "dropdown-item #{'active' if params[:q][:status_eq] == 'active'}" %>
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
|
|
32
32
|
<h6 class="dropdown-header"><%= Spree.t('admin.products.by_stock') %>:</h6>
|
|
33
33
|
|
|
34
|
-
<%= active_link_to Spree.t('admin.products.any_stock'), params.to_unsafe_h.deep_merge({page: nil, q: {
|
|
34
|
+
<%= active_link_to Spree.t('admin.products.any_stock'), params.to_unsafe_h.deep_merge({page: nil, q: {in_stock: nil, out_of_stock: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[status_eq in_stock out_of_stock] ).all?(&:blank?) %>
|
|
35
35
|
<%= link_to Spree.t('admin.products.in_stock'),
|
|
36
|
-
params.to_unsafe_h.deep_merge({page: nil, q: {
|
|
37
|
-
class: "dropdown-item #{'active' if params[:q][:
|
|
36
|
+
params.to_unsafe_h.deep_merge({page: nil, q: {in_stock: '1', out_of_stock: nil}}),
|
|
37
|
+
class: "dropdown-item #{'active' if params[:q][:in_stock] == '1'}" %>
|
|
38
38
|
<%= link_to Spree.t('admin.products.out_of_stock'),
|
|
39
|
-
params.to_unsafe_h.deep_merge({page: nil, q: {
|
|
40
|
-
class: "dropdown-item #{'active' if params[:q][:
|
|
39
|
+
params.to_unsafe_h.deep_merge({page: nil, q: {out_of_stock: '1', in_stock: nil}}),
|
|
40
|
+
class: "dropdown-item #{'active' if params[:q][:out_of_stock] == '1'}" %>
|
|
41
41
|
<% end %>
|
|
42
42
|
<% end %>
|
|
@@ -98,7 +98,7 @@ Rails.application.config.after_initialize do
|
|
|
98
98
|
displayable: false,
|
|
99
99
|
default: false,
|
|
100
100
|
position: 70,
|
|
101
|
-
ransack_attribute: '
|
|
101
|
+
ransack_attribute: 'in_stock'
|
|
102
102
|
|
|
103
103
|
# Taxons - displayed as comma-separated list, filtered via autocomplete
|
|
104
104
|
Spree.admin.tables.products.add :taxons,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.4.0.
|
|
4
|
+
version: 5.4.0.beta3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vendo Connect Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02
|
|
11
|
+
date: 2026-03-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: spree
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 5.4.0.
|
|
19
|
+
version: 5.4.0.beta3
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 5.4.0.
|
|
26
|
+
version: 5.4.0.beta3
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: active_link_to
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -1242,9 +1242,9 @@ licenses:
|
|
|
1242
1242
|
- BSD-3-Clause
|
|
1243
1243
|
metadata:
|
|
1244
1244
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
|
1245
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.4.0.
|
|
1245
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.4.0.beta3
|
|
1246
1246
|
documentation_uri: https://docs.spreecommerce.org/
|
|
1247
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.4.0.
|
|
1247
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.4.0.beta3
|
|
1248
1248
|
post_install_message:
|
|
1249
1249
|
rdoc_options: []
|
|
1250
1250
|
require_paths:
|