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.

Use `auto-submit` controller instead of `form` controller (#12308)

Damian Kaczmarczyk6cfdfaea61a9
diff --git a/admin/app/views/spree/admin/orders/billing_address/_form.html.erb b/admin/app/views/spree/admin/orders/billing_address/_form.html.erb
index 863d3a2d76..de1fd641b2 100644
--- a/admin/app/views/spree/admin/orders/billing_address/_form.html.erb
+++ b/admin/app/views/spree/admin/orders/billing_address/_form.html.erb
@@ -9,6 +9,6 @@
<% if @order.user.present? && @order.user.addresses.many? %>
<div data-form="existing_address" class="d-none">
<%= label_tag :billing_address_id, Spree.t(:existing_address), class: "sr-only" %>
- <%= tom_select_tag :billing_address_id, {include_blank: Spree.t(:existing_address), class: "mb-2", options: @order.user.addresses.map { |a| {id: a.id, name: a.to_s.gsub('<br/>', ", ")}}.as_json, select_data: {action: 'form#submit'} } %>
+ <%= tom_select_tag :billing_address_id, {include_blank: Spree.t(:existing_address), class: "mb-2", options: @order.user.addresses.map { |a| {id: a.id, name: a.to_s.gsub('<br/>', ", ")}}.as_json, select_data: {action: 'auto-submit#submit'} } %>
</div>
<% end %>
diff --git a/admin/app/views/spree/admin/orders/shipping_address/_form.html.erb b/admin/app/views/spree/admin/orders/shipping_address/_form.html.erb
index 594ca7e986..e1c797a3d7 100644
--- a/admin/app/views/spree/admin/orders/shipping_address/_form.html.erb
+++ b/admin/app/views/spree/admin/orders/shipping_address/_form.html.erb
@@ -8,6 +8,6 @@
<div>
<div class="w-100 text-center mb-2"><%= Spree.t(:or_select_other_address) %></div>
<%= label_tag :shipping_address_id, Spree.t(:existing_address), class: "sr-only" %>
- <%= tom_select_tag :shipping_address_id, {include_blank: Spree.t(:existing_address), class: "mb-2", options: @order.user.addresses.map { |a| {id: a.id, name: a.to_s.gsub('<br/>', ", ")}}.as_json, select_data: {action: 'form#submit'} } %>
+ <%= tom_select_tag :shipping_address_id, {include_blank: Spree.t(:existing_address), class: "mb-2", options: @order.user.addresses.map { |a| {id: a.id, name: a.to_s.gsub('<br/>', ", ")}}.as_json, select_data: {action: 'auto-submit#submit'} } %>
</div>
<% end %>
diff --git a/admin/app/views/spree/admin/taxons/edit.html.erb b/admin/app/views/spree/admin/taxons/edit.html.erb
index 2483f721e6..2b8ff36e5e 100644
--- a/admin/app/views/spree/admin/taxons/edit.html.erb
+++ b/admin/app/views/spree/admin/taxons/edit.html.erb
@@ -13,7 +13,7 @@
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @taxon } %>
-<%= form_for @taxon, as: :taxon, method: :put, url: form_url, html: { multipart: true }, data: { auto_submit_target: 'form', controller: 'auto-submit' } do |f| %>
+<%= form_for @taxon, as: :taxon, method: :put, url: form_url, html: { multipart: true }, data: { controller: 'auto-submit' } do |f| %>
<%= render 'form', f: f %>
<%= render 'spree/admin/shared/edit_resource_links', f: f %>
<% end %>
diff --git a/admin/app/views/spree/admin/translations/edit.html.erb b/admin/app/views/spree/admin/translations/edit.html.erb
index a8a1349548..f359c4f732 100644
--- a/admin/app/views/spree/admin/translations/edit.html.erb
+++ b/admin/app/views/spree/admin/translations/edit.html.erb
@@ -4,10 +4,10 @@
<% end %>
<% if @locales.any?%>
<% if @locales.many? %>
- <%= form_with url: spree.edit_admin_translation_path(@resource, resource_type: @resource.class.to_s), class: "w-100 d-flex justify-content-end", data: { auto_submit_target: 'form', controller: 'auto-submit', turbo_frame: 'translations_table'}, method: :get do |f| %>
+ <%= form_with url: spree.edit_admin_translation_path(@resource, resource_type: @resource.class.to_s), class: "w-100 d-flex justify-content-end", data: { controller: 'auto-submit', turbo_frame: 'translations_table'}, method: :get do |f| %>
<div class="form-inline gap-2">
<%= f.label :translation_locale, Spree.t(:language) %>
- <%= f.select :translation_locale, options_for_select(@locales.map { |locale| [Spree.t('i18n.this_file_language', locale: locale), locale] }, @selected_translation_locale), {}, { class: 'custom-select', data: { action: 'change->auto-submit#submitForm' } } %>
+ <%= f.select :translation_locale, options_for_select(@locales.map { |locale| [Spree.t('i18n.this_file_language', locale: locale), locale] }, @selected_translation_locale), {}, { class: 'custom-select', data: { action: 'change->auto-submit#submit' } } %>
</div>
<% end %>
<% end %>