Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed taxon sort order dropdown in admin (#13030)

Damian Legawiec24c5de76cf72
diff --git a/admin/app/controllers/spree/admin/taxons_controller.rb b/admin/app/controllers/spree/admin/taxons_controller.rb
index 1926880d6e..b1b379b9d1 100644
--- a/admin/app/controllers/spree/admin/taxons_controller.rb
+++ b/admin/app/controllers/spree/admin/taxons_controller.rb
@@ -52,6 +52,10 @@ module Spree
spree.edit_admin_taxonomy_taxon_path(@taxon.taxonomy_id, @taxon.id)
end
+ def update_turbo_stream_enabled?
+ true
+ end
+
def destroy_turbo_stream_enabled?
true && !params[:force_redirect].to_b
end
diff --git a/admin/app/views/spree/admin/taxons/_form.html.erb b/admin/app/views/spree/admin/taxons/_form.html.erb
index b5a6877048..834c79680e 100644
--- a/admin/app/views/spree/admin/taxons/_form.html.erb
+++ b/admin/app/views/spree/admin/taxons/_form.html.erb
@@ -62,8 +62,7 @@
<div class="card-body border-bottom">
<div class="d-flex align-items-center">
- <%= f.label :sort_order, class: 'text-nowrap mr-2 mb-0' %>
- <%= f.spree_select :sort_order, taxon_sort_options_for_select, {}, { class: 'custom-select-sm w-auto', data: { action: 'change->auto-submit#submit' } } %>
+ <%= f.spree_select :sort_order, taxon_sort_options_for_select, {}, { class: 'custom-select custom-select-sm w-auto ml-2', data: { action: 'change->auto-submit#submit' } } %>
</div>
</div>
diff --git a/admin/app/views/spree/admin/taxons/update.turbo_stream.erb b/admin/app/views/spree/admin/taxons/update.turbo_stream.erb
new file mode 100644
index 0000000000..9d3f71f185
--- /dev/null
+++ b/admin/app/views/spree/admin/taxons/update.turbo_stream.erb
@@ -0,0 +1,7 @@
+<%= turbo_render_alerts %>
+
+<%= turbo_stream.replace :classifications do %>
+ <%= turbo_frame_tag :classifications, src: spree.admin_taxon_classifications_path(@taxon.id) do %>
+ <%= render 'spree/admin/shared/spinner' %>
+ <% end %>
+<% end %>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index cf7fd5d7dd..f15ce0fe43 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -187,6 +187,7 @@ en:
name: Name
permalink: Permalink
position: Position
+ sort_order: Sort Order
spree/taxonomy:
name: Name
spree/user: