spree_admin 5.4.2 → 5.4.3
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/bulk_operations_controller.rb +4 -0
- data/app/controllers/spree/admin/invitations_controller.rb +1 -2
- data/app/controllers/spree/admin/resource_controller.rb +11 -2
- data/app/controllers/spree/admin/states_controller.rb +13 -0
- data/app/controllers/spree/admin/zones_controller.rb +0 -1
- data/app/javascript/spree/admin/application.js +2 -0
- data/app/javascript/spree/admin/controllers/zone_state_select_controller.js +31 -0
- data/app/views/spree/admin/gift_cards/_form.html.erb +1 -1
- data/app/views/spree/admin/invitations/expired.html.erb +4 -0
- data/app/views/spree/admin/orders/_line_item.html.erb +3 -3
- data/app/views/spree/admin/orders/_shipment.html.erb +1 -1
- data/app/views/spree/admin/zones/_state_members.html.erb +14 -4
- data/config/initializers/spree_admin_tables.rb +2 -2
- data/config/routes.rb +10 -1
- data/lib/spree/admin/tailwind_helper.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a5af2b78a13b13f570093bfe92c6d6c6b3ade67ec72e294fbf0f1ffd9c121d6
|
|
4
|
+
data.tar.gz: 6dfa405d89717625d66b270fe16f7343bb8ec532f8ba673ee856361eb3682e92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9172a34304882f931b1bf56502ffd09121ca3497d8e3b24b5520dc03cf6cebf5a70c6e284615098dc4c70462f153aa204899911f152902e75317b5130760222d
|
|
7
|
+
data.tar.gz: 91f7065af97ecddea447d6add3cd60ab8d36ceb6590ced8ca3e74bbe65a26eeded78625209b38e5b5ad9f26e43605bdc05fb594664f0d1aad1fbe51af22f17b9
|
|
@@ -63,8 +63,7 @@ module Spree
|
|
|
63
63
|
redirect_to spree.new_admin_admin_user_path(token: @invitation.token), status: :see_other
|
|
64
64
|
end
|
|
65
65
|
rescue ActiveRecord::RecordNotFound
|
|
66
|
-
|
|
67
|
-
nil
|
|
66
|
+
render :expired, status: :not_found
|
|
68
67
|
end
|
|
69
68
|
|
|
70
69
|
# PUT /admin/invitations/:id/accept
|
|
@@ -279,8 +279,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
279
279
|
|
|
280
280
|
params[:q][:s] ||= collection_default_sort if collection_default_sort.present?
|
|
281
281
|
|
|
282
|
-
|
|
283
|
-
date_range_params.each do |param|
|
|
282
|
+
%i[created_at_gt updated_at_gt].each do |param|
|
|
284
283
|
if params[:q][param].present?
|
|
285
284
|
params[:q][param] = begin
|
|
286
285
|
params[:q][param].to_date&.in_time_zone(current_timezone)&.beginning_of_day
|
|
@@ -290,6 +289,16 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
290
289
|
end
|
|
291
290
|
end
|
|
292
291
|
|
|
292
|
+
%i[created_at_lt updated_at_lt].each do |param|
|
|
293
|
+
if params[:q][param].present?
|
|
294
|
+
params[:q][param] = begin
|
|
295
|
+
params[:q][param].to_date&.in_time_zone(current_timezone)&.end_of_day
|
|
296
|
+
rescue StandardError
|
|
297
|
+
''
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
293
302
|
params[:q]
|
|
294
303
|
end
|
|
295
304
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
module Admin
|
|
3
|
+
class StatesController < ResourceController
|
|
4
|
+
belongs_to 'spree/country', find_by: :id
|
|
5
|
+
|
|
6
|
+
def select_options
|
|
7
|
+
states = @country.states.accessible_by(current_ability).order(:name)
|
|
8
|
+
|
|
9
|
+
render json: states.to_tom_select_json
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -92,6 +92,7 @@ import TooltipController from 'spree/admin/controllers/tooltip_controller'
|
|
|
92
92
|
import TurboSubmitButtonController from 'spree/admin/controllers/turbo_submit_button_controller'
|
|
93
93
|
import UnitSystemController from 'spree/admin/controllers/unit_system_controller'
|
|
94
94
|
import VariantsFormController from 'spree/admin/controllers/variants_form_controller'
|
|
95
|
+
import ZoneStateSelectController from 'spree/admin/controllers/zone_state_select_controller'
|
|
95
96
|
import BulkEditorController from 'spree/admin/controllers/bulk_editor_controller'
|
|
96
97
|
import AddressAutocompleteController from 'spree/core/controllers/address_autocomplete_controller'
|
|
97
98
|
import AddressFormController from 'spree/core/controllers/address_form_controller'
|
|
@@ -166,6 +167,7 @@ application.register('turbo-submit-button', TurboSubmitButtonController)
|
|
|
166
167
|
application.register('textarea-autogrow', TextareaAutogrow)
|
|
167
168
|
application.register('unit-system', UnitSystemController)
|
|
168
169
|
application.register('variants-form', VariantsFormController)
|
|
170
|
+
application.register('zone-state-select', ZoneStateSelectController)
|
|
169
171
|
application.register('bulk-editor', BulkEditorController)
|
|
170
172
|
|
|
171
173
|
LocalTime.start()
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
import { get } from '@rails/request.js'
|
|
3
|
+
|
|
4
|
+
export default class extends Controller {
|
|
5
|
+
static values = {
|
|
6
|
+
url: String
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static targets = ["statesSelect"]
|
|
10
|
+
|
|
11
|
+
async countryChanged(event) {
|
|
12
|
+
const countryId = event.target.value
|
|
13
|
+
const statesInput = this.statesSelectTarget.querySelector('select')
|
|
14
|
+
if (!statesInput || !statesInput.tomselect) return
|
|
15
|
+
|
|
16
|
+
const tomSelect = statesInput.tomselect
|
|
17
|
+
tomSelect.clear()
|
|
18
|
+
tomSelect.clearOptions()
|
|
19
|
+
|
|
20
|
+
if (!countryId) return
|
|
21
|
+
|
|
22
|
+
const url = this.urlValue.replace(':country_id', countryId)
|
|
23
|
+
const response = await get(url, { contentType: 'application/json' })
|
|
24
|
+
|
|
25
|
+
if (response.ok) {
|
|
26
|
+
const states = await response.json
|
|
27
|
+
states.forEach(state => tomSelect.addOption(state))
|
|
28
|
+
tomSelect.refreshOptions(false)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="card mb-6">
|
|
2
2
|
<div class="card-body">
|
|
3
3
|
<% unless f.object.persisted? %>
|
|
4
|
-
<%= f.spree_text_field :code,
|
|
4
|
+
<%= f.spree_text_field :code, help_bubble: Spree.t('admin.gift_cards.code_help_text'), autofocus: true %>
|
|
5
5
|
<% end %>
|
|
6
6
|
|
|
7
7
|
<%= f.spree_money_field :amount, currency: f.object.currency, required: true %>
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
<%= dropdown_menu do %>
|
|
31
31
|
<%= link_to_with_icon "edit",
|
|
32
32
|
Spree.t(:edit),
|
|
33
|
-
spree.edit_admin_order_line_item_path(
|
|
33
|
+
spree.edit_admin_order_line_item_path(line_item.order, line_item),
|
|
34
34
|
class: "dropdown-item" %>
|
|
35
35
|
<% if line_item.digital_links.any? %>
|
|
36
36
|
<%= link_to_with_icon "refresh",
|
|
37
37
|
Spree.t("admin.reset_digital_link_download_limits"),
|
|
38
|
-
spree.reset_digital_links_limit_admin_order_line_item_path(
|
|
38
|
+
spree.reset_digital_links_limit_admin_order_line_item_path(line_item.order, line_item),
|
|
39
39
|
data: {
|
|
40
40
|
turbo_method: :post,
|
|
41
41
|
turbo_confirm: Spree.t(:are_you_sure),
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
<% if can?(:destroy, line_item) %>
|
|
48
48
|
<div class="dropdown-divider"></div>
|
|
49
|
-
<%= link_to_with_icon "trash", Spree.t('actions.destroy'), spree.admin_order_line_item_path(
|
|
49
|
+
<%= link_to_with_icon "trash", Spree.t('actions.destroy'), spree.admin_order_line_item_path(line_item.order, line_item), data: { turbo_method: :delete, turbo_frame: '_top', turbo_confirm: Spree.t(:are_you_sure )}, class: 'dropdown-item text-red-600 hover:bg-red-100' %>
|
|
50
50
|
<% end %>
|
|
51
51
|
<% end %>
|
|
52
52
|
<% end %>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<% if can_ship?(shipment) %>
|
|
88
88
|
<div class="card-footer flex justify-end border-t bg-gray-25">
|
|
89
89
|
<% if shipment.tracked? %>
|
|
90
|
-
<%= link_to_with_icon 'send.svg', Spree.t(:ship), spree.ship_admin_order_shipment_path(order, shipment), class: 'ml-auto btn btn-primary mb-0', data: {turbo_method: :post, turbo_confirm: Spree.t(:are_you_sure)} %>
|
|
90
|
+
<%= link_to_with_icon 'send.svg', Spree.t(:ship), spree.ship_admin_order_shipment_path(order, shipment), class: 'ml-auto btn btn-primary mb-0', data: {turbo_method: :post, turbo_confirm: Spree.t(:are_you_sure), turbo_frame: '_top'} %>
|
|
91
91
|
<% elsif !shipment.digital? %>
|
|
92
92
|
<span class="ship ml-auto btn btn-primary disabled mb-0" data-controller="tooltip" data-tooltip-placement-value="left">
|
|
93
93
|
<%= icon 'send' %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div id="state_members">
|
|
1
|
+
<div id="state_members" data-controller="zone-state-select" data-zone-state-select-url-value="<%= spree.select_options_admin_country_states_path(':country_id') %>">
|
|
2
2
|
<div class="card mb-6">
|
|
3
3
|
<div class="card-header">
|
|
4
4
|
<h5 class="card-title">
|
|
@@ -9,12 +9,22 @@
|
|
|
9
9
|
<div class="card-body">
|
|
10
10
|
<div class="form-group">
|
|
11
11
|
<%= label_tag :states_country_id, Spree.t(:country) %>
|
|
12
|
-
<%= tom_select_tag :states_country_id,
|
|
12
|
+
<%= tom_select_tag :states_country_id,
|
|
13
|
+
class: 'w-full',
|
|
14
|
+
options: Spree::Country.joins(:states).distinct.to_tom_select_json,
|
|
15
|
+
active_option: @selected_country&.id,
|
|
16
|
+
select_data: {action: "change->zone-state-select#countryChanged"}
|
|
17
|
+
%>
|
|
13
18
|
</div>
|
|
14
19
|
|
|
15
|
-
<div class="form-group">
|
|
20
|
+
<div class="form-group" data-zone-state-select-target="statesSelect">
|
|
16
21
|
<%= zone_form.label :state_ids, Spree.t(:states) %>
|
|
17
|
-
<%= tom_select_tag 'zone[state_ids]',
|
|
22
|
+
<%= tom_select_tag 'zone[state_ids]',
|
|
23
|
+
multiple: true,
|
|
24
|
+
class: 'w-full',
|
|
25
|
+
url: @selected_country ? spree.select_options_admin_country_states_path(@selected_country) : nil,
|
|
26
|
+
active_option: @zone.state_ids
|
|
27
|
+
%>
|
|
18
28
|
</div>
|
|
19
29
|
</div>
|
|
20
30
|
</div>
|
|
@@ -135,7 +135,7 @@ Rails.application.config.after_initialize do
|
|
|
135
135
|
action_path: ->(view_context) { view_context.spree.bulk_status_update_admin_products_path(status: 'active') },
|
|
136
136
|
body: 'admin.bulk_ops.products.body.set_active',
|
|
137
137
|
position: 10,
|
|
138
|
-
condition: -> { can?(:
|
|
138
|
+
condition: -> { can?(:bulk_activate, Spree::Product) }
|
|
139
139
|
|
|
140
140
|
Spree.admin.tables.products.add_bulk_action :set_draft,
|
|
141
141
|
label: 'admin.bulk_ops.products.title.set_draft',
|
|
@@ -462,7 +462,7 @@ Rails.application.config.after_initialize do
|
|
|
462
462
|
position: 30,
|
|
463
463
|
ransack_attribute: 'addresses_country_name',
|
|
464
464
|
operators: %i[eq],
|
|
465
|
-
search_url: ->(view_context) { view_context.spree.
|
|
465
|
+
search_url: ->(view_context) { view_context.spree.select_options_admin_countries_path(format: :json) },
|
|
466
466
|
partial: 'spree/admin/tables/columns/user_location'
|
|
467
467
|
|
|
468
468
|
# Number of orders
|
data/config/routes.rb
CHANGED
|
@@ -62,9 +62,18 @@ Spree::Core::Engine.add_routes do
|
|
|
62
62
|
end
|
|
63
63
|
get '/taxons/select_options' => 'taxons#select_options', as: :taxons_select_options, defaults: { format: :json }
|
|
64
64
|
get '/tags/select_options' => 'tags#select_options', as: :tags_select_options, defaults: { format: :json }
|
|
65
|
-
get '/countries/select_options' => 'countries#select_options', as: :countries_select_options, defaults: { format: :json }
|
|
66
65
|
get '/users/select_options' => 'users#select_options', as: :users_select_options, defaults: { format: :json }
|
|
67
66
|
get '/stock_locations/select_options' => 'stock_locations#select_options', as: :stock_locations_select_options, defaults: { format: :json }
|
|
67
|
+
resources :countries, only: [] do
|
|
68
|
+
collection do
|
|
69
|
+
get :select_options, defaults: { format: :json }
|
|
70
|
+
end
|
|
71
|
+
resources :states, only: [] do
|
|
72
|
+
collection do
|
|
73
|
+
get :select_options, defaults: { format: :json }
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
68
77
|
|
|
69
78
|
# media library
|
|
70
79
|
resources :assets, only: [:create, :edit, :update, :destroy] do
|
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.
|
|
4
|
+
version: 5.4.3
|
|
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-
|
|
11
|
+
date: 2026-05-19 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.
|
|
19
|
+
version: 5.4.3
|
|
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.
|
|
26
|
+
version: 5.4.3
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: active_link_to
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -364,6 +364,7 @@ files:
|
|
|
364
364
|
- app/controllers/spree/admin/shipments_controller.rb
|
|
365
365
|
- app/controllers/spree/admin/shipping_categories_controller.rb
|
|
366
366
|
- app/controllers/spree/admin/shipping_methods_controller.rb
|
|
367
|
+
- app/controllers/spree/admin/states_controller.rb
|
|
367
368
|
- app/controllers/spree/admin/stock_items_controller.rb
|
|
368
369
|
- app/controllers/spree/admin/stock_locations_controller.rb
|
|
369
370
|
- app/controllers/spree/admin/stock_movements_controller.rb
|
|
@@ -479,6 +480,7 @@ files:
|
|
|
479
480
|
- app/javascript/spree/admin/controllers/turbo_submit_button_controller.js
|
|
480
481
|
- app/javascript/spree/admin/controllers/unit_system_controller.js
|
|
481
482
|
- app/javascript/spree/admin/controllers/variants_form_controller.js
|
|
483
|
+
- app/javascript/spree/admin/controllers/zone_state_select_controller.js
|
|
482
484
|
- app/javascript/spree/admin/helpers/index.js
|
|
483
485
|
- app/javascript/spree/admin/helpers/tinymce.js
|
|
484
486
|
- app/javascript/spree/admin/helpers/trix/video_embed.js
|
|
@@ -621,6 +623,7 @@ files:
|
|
|
621
623
|
- app/views/spree/admin/integrations/new.html.erb
|
|
622
624
|
- app/views/spree/admin/invitations/_invitation.html.erb
|
|
623
625
|
- app/views/spree/admin/invitations/create.turbo_stream.erb
|
|
626
|
+
- app/views/spree/admin/invitations/expired.html.erb
|
|
624
627
|
- app/views/spree/admin/invitations/index.html.erb
|
|
625
628
|
- app/views/spree/admin/invitations/new.html.erb
|
|
626
629
|
- app/views/spree/admin/invitations/show.html.erb
|
|
@@ -1161,9 +1164,9 @@ licenses:
|
|
|
1161
1164
|
- BSD-3-Clause
|
|
1162
1165
|
metadata:
|
|
1163
1166
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
|
1164
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.4.
|
|
1167
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.4.3
|
|
1165
1168
|
documentation_uri: https://docs.spreecommerce.org/
|
|
1166
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.4.
|
|
1169
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.4.3
|
|
1167
1170
|
post_install_message:
|
|
1168
1171
|
rdoc_options: []
|
|
1169
1172
|
require_paths:
|