<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %>
<% end %>
diff --git a/admin/app/components/solidus_admin/store_credit_reasons/edit/component.rb b/admin/app/components/solidus_admin/store_credit_reasons/edit/component.rb
index 8a079ff9e96..5b95956b8d1 100644
--- a/admin/app/components/solidus_admin/store_credit_reasons/edit/component.rb
+++ b/admin/app/components/solidus_admin/store_credit_reasons/edit/component.rb
@@ -9,4 +9,8 @@ def initialize(page:, store_credit_reason:)
def form_id
dom_id(@store_credit_reason, "#{stimulus_id}_edit_store_credit_reason_form")
end
+
+ def close_path
+ solidus_admin.store_credit_reasons_path(**search_filter_params)
+ end
end
diff --git a/admin/app/components/solidus_admin/store_credit_reasons/index/component.rb b/admin/app/components/solidus_admin/store_credit_reasons/index/component.rb
index 744045ba2c6..f6cdb0ab1b4 100644
--- a/admin/app/components/solidus_admin/store_credit_reasons/index/component.rb
+++ b/admin/app/components/solidus_admin/store_credit_reasons/index/component.rb
@@ -23,7 +23,11 @@ def turbo_frames
end
def row_url(store_credit_reason)
- spree.edit_admin_store_credit_reason_path(store_credit_reason, _turbo_frame: :edit_store_credit_reason_modal)
+ edit_path(store_credit_reason)
+ end
+
+ def edit_path(store_credit_reason)
+ spree.edit_admin_store_credit_reason_path(store_credit_reason, **search_filter_params)
end
def search_url
@@ -47,7 +51,12 @@ def batch_actions
def columns
[
- :name,
+ {
+ header: :name,
+ data: ->(store_credit_reason) do
+ link_to store_credit_reason.name, edit_path(store_credit_reason), class: "body-link"
+ end
+ },
{
header: :active,
data: ->(store_credit_reason) do
diff --git a/admin/app/components/solidus_admin/stores/index/component.rb b/admin/app/components/solidus_admin/stores/index/component.rb
index 5df8aa80005..af8fc0f9778 100644
--- a/admin/app/components/solidus_admin/stores/index/component.rb
+++ b/admin/app/components/solidus_admin/stores/index/component.rb
@@ -14,6 +14,10 @@ def search_url
end
def row_url(store)
+ edit_path(store)
+ end
+
+ def edit_path(store)
spree.edit_admin_store_path(store)
end
@@ -39,12 +43,22 @@ def batch_actions
def columns
[
- :name,
- :url,
+ {
+ header: :name,
+ data: ->(store) do
+ link_to store.name, edit_path(store), class: "body-link"
+ end
+ },
+ {
+ header: :url,
+ data: ->(store) do
+ link_to store.url, edit_path(store), class: "body-link"
+ end
+ },
{
header: :slug,
data: ->(store) do
- content_tag :div, store.code
+ link_to store.code, edit_path(store), class: "body-link"
end
},
{
diff --git a/admin/app/components/solidus_admin/tax_categories/edit/component.html.erb b/admin/app/components/solidus_admin/tax_categories/edit/component.html.erb
index a5feeef7251..ac927aa20bb 100644
--- a/admin/app/components/solidus_admin/tax_categories/edit/component.html.erb
+++ b/admin/app/components/solidus_admin/tax_categories/edit/component.html.erb
@@ -1,4 +1,4 @@
-<%= turbo_frame_tag :edit_tax_category_modal do %>
+<%= turbo_frame_tag :edit_tax_category_modal, target: "_top" do %>
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
<%= form_for @tax_category, url: solidus_admin.tax_category_path(@tax_category), html: { id: form_id } do |f| %>
diff --git a/admin/app/components/solidus_admin/tax_categories/index/component.rb b/admin/app/components/solidus_admin/tax_categories/index/component.rb
index c2ce2b16ca2..9b0e7f107ae 100644
--- a/admin/app/components/solidus_admin/tax_categories/index/component.rb
+++ b/admin/app/components/solidus_admin/tax_categories/index/component.rb
@@ -2,7 +2,11 @@
class SolidusAdmin::TaxCategories::Index::Component < SolidusAdmin::Taxes::Component
def row_url(tax_category)
- spree.edit_admin_tax_category_path(tax_category, _turbo_frame: :edit_tax_category_modal)
+ edit_path(tax_category)
+ end
+
+ def edit_path(tax_category)
+ spree.edit_admin_tax_category_path(tax_category)
end
def model_class
@@ -47,9 +51,24 @@ def batch_actions
def columns
[
- :name,
- :tax_code,
- :description,
+ {
+ header: :name,
+ data: ->(tax_category) do
+ link_to tax_category.name, edit_path(tax_category), class: "body-link"
+ end
+ },
+ {
+ header: :tax_code,
+ data: ->(tax_category) do
+ link_to_if tax_category.tax_code, tax_category.tax_code, edit_path(tax_category), class: "body-link"
+ end
+ },
+ {
+ header: :description,
+ data: ->(tax_category) do
+ link_to tax_category.description, edit_path(tax_category), class: "body-link"
+ end
+ },
{
header: :is_default,
data: ->(tax_category) {
diff --git a/admin/app/components/solidus_admin/tax_rates/index/component.rb b/admin/app/components/solidus_admin/tax_rates/index/component.rb
index 148d280a682..5c326ed8238 100644
--- a/admin/app/components/solidus_admin/tax_rates/index/component.rb
+++ b/admin/app/components/solidus_admin/tax_rates/index/component.rb
@@ -2,6 +2,10 @@
class SolidusAdmin::TaxRates::Index::Component < SolidusAdmin::Taxes::Component
def row_url(tax_rate)
+ edit_path(tax_rate)
+ end
+
+ def edit_path(tax_rate)
spree.edit_admin_tax_rate_path(tax_rate)
end
@@ -61,7 +65,12 @@ def columns
header: :zone,
data: -> { _1.zone&.name },
},
- :name,
+ {
+ header: :name,
+ data: ->(tax_rate) do
+ link_to tax_rate.name, edit_path(tax_rate), class: "body-link"
+ end
+ },
{
header: :tax_categories,
data: -> { _1.tax_categories.map(&:name).join(', ') },
diff --git a/admin/app/components/solidus_admin/taxonomies/index/component.rb b/admin/app/components/solidus_admin/taxonomies/index/component.rb
index e1a47ae8f60..276b18d73e8 100644
--- a/admin/app/components/solidus_admin/taxonomies/index/component.rb
+++ b/admin/app/components/solidus_admin/taxonomies/index/component.rb
@@ -6,6 +6,10 @@ def model_class
end
def row_url(taxonomy)
+ edit_path(taxonomy)
+ end
+
+ def edit_path(taxonomy)
spree.edit_admin_taxonomy_path(taxonomy)
end
@@ -46,7 +50,7 @@ def name_column
{
header: :name,
data: ->(taxonomy) do
- content_tag :div, taxonomy.name
+ link_to taxonomy.name, edit_path(taxonomy), class: "body-link"
end
}
end
diff --git a/admin/app/components/solidus_admin/ui/modal/component.html.erb b/admin/app/components/solidus_admin/ui/modal/component.html.erb
index 8b408161258..8a7697dd05e 100644
--- a/admin/app/components/solidus_admin/ui/modal/component.html.erb
+++ b/admin/app/components/solidus_admin/ui/modal/component.html.erb
@@ -14,13 +14,13 @@
<%= @title %>
-
+ <%= render component('ui/button').new(
+ tag: 'a',
+ icon: 'close-line',
+ scheme: :ghost,
+ title: t('.close'),
+ href: @close_path
+ ) %>
diff --git a/admin/app/controllers/solidus_admin/adjustment_reasons_controller.rb b/admin/app/controllers/solidus_admin/adjustment_reasons_controller.rb
index 64793387604..739992efe6a 100644
--- a/admin/app/controllers/solidus_admin/adjustment_reasons_controller.rb
+++ b/admin/app/controllers/solidus_admin/adjustment_reasons_controller.rb
@@ -61,17 +61,8 @@ def edit
def update
if @adjustment_reason.update(adjustment_reason_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.adjustment_reasons_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.adjustment_reasons_path(**search_filter_params), status: :see_other
else
set_index_page
diff --git a/admin/app/controllers/solidus_admin/refund_reasons_controller.rb b/admin/app/controllers/solidus_admin/refund_reasons_controller.rb
index 92e8c5b2195..161d82d19b9 100644
--- a/admin/app/controllers/solidus_admin/refund_reasons_controller.rb
+++ b/admin/app/controllers/solidus_admin/refund_reasons_controller.rb
@@ -61,17 +61,8 @@ def edit
def update
if @refund_reason.update(refund_reason_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.refund_reasons_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.refund_reasons_path(**search_filter_params), status: :see_other
else
set_index_page
diff --git a/admin/app/controllers/solidus_admin/return_reasons_controller.rb b/admin/app/controllers/solidus_admin/return_reasons_controller.rb
index 892603806ca..ac6ef69ae55 100644
--- a/admin/app/controllers/solidus_admin/return_reasons_controller.rb
+++ b/admin/app/controllers/solidus_admin/return_reasons_controller.rb
@@ -61,17 +61,8 @@ def edit
def update
if @return_reason.update(return_reason_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.return_reasons_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.return_reasons_path(**search_filter_params), status: :see_other
else
set_index_page
diff --git a/admin/app/controllers/solidus_admin/roles_controller.rb b/admin/app/controllers/solidus_admin/roles_controller.rb
index fea6e2f5b0f..76d08380ffe 100644
--- a/admin/app/controllers/solidus_admin/roles_controller.rb
+++ b/admin/app/controllers/solidus_admin/roles_controller.rb
@@ -64,17 +64,8 @@ def edit
def update
if @role.update(role_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.roles_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.roles_path(**search_filter_params), status: :see_other
else
set_index_page
diff --git a/admin/app/controllers/solidus_admin/shipping_categories_controller.rb b/admin/app/controllers/solidus_admin/shipping_categories_controller.rb
index a7a58686da7..6e686ee3b4c 100644
--- a/admin/app/controllers/solidus_admin/shipping_categories_controller.rb
+++ b/admin/app/controllers/solidus_admin/shipping_categories_controller.rb
@@ -63,17 +63,8 @@ def edit
def update
if @shipping_category.update(shipping_category_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.shipping_categories_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.shipping_categories_path(**search_filter_params), status: :see_other
else
set_index_page
diff --git a/admin/app/controllers/solidus_admin/stock_items_controller.rb b/admin/app/controllers/solidus_admin/stock_items_controller.rb
index 1333dbe672c..76c32b8743c 100644
--- a/admin/app/controllers/solidus_admin/stock_items_controller.rb
+++ b/admin/app/controllers/solidus_admin/stock_items_controller.rb
@@ -30,10 +30,8 @@ def update
@stock_item.stock_movements.build(quantity: quantity_adjustment, originator: current_solidus_admin_user)
if @stock_item.save
- respond_to do |format|
- format.html { redirect_to solidus_admin.stock_items_path, status: :see_other }
- format.turbo_stream { render turbo_stream: '' }
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.stock_items_path, status: :see_other
else
respond_to do |format|
format.html { render component('stock_items/edit').new(stock_item: @stock_item, page: @page), status: :unprocessable_entity }
diff --git a/admin/app/controllers/solidus_admin/store_credit_reasons_controller.rb b/admin/app/controllers/solidus_admin/store_credit_reasons_controller.rb
index 98bbd0615bf..749371ad83b 100644
--- a/admin/app/controllers/solidus_admin/store_credit_reasons_controller.rb
+++ b/admin/app/controllers/solidus_admin/store_credit_reasons_controller.rb
@@ -61,17 +61,8 @@ def edit
def update
if @store_credit_reason.update(store_credit_reason_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.store_credit_reasons_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.store_credit_reasons_path(**search_filter_params), status: :see_other
else
set_index_page
diff --git a/admin/app/controllers/solidus_admin/tax_categories_controller.rb b/admin/app/controllers/solidus_admin/tax_categories_controller.rb
index 96a7d96a750..e591fac5090 100644
--- a/admin/app/controllers/solidus_admin/tax_categories_controller.rb
+++ b/admin/app/controllers/solidus_admin/tax_categories_controller.rb
@@ -57,17 +57,8 @@ def create
def update
if @tax_category.update(tax_category_params)
- respond_to do |format|
- flash[:notice] = t('.success')
-
- format.html do
- redirect_to solidus_admin.tax_categories_path, status: :see_other
- end
-
- format.turbo_stream do
- render turbo_stream: ''
- end
- end
+ flash[:notice] = t('.success')
+ redirect_to solidus_admin.tax_categories_path, status: :see_other
else
set_index_page
diff --git a/admin/app/helpers/solidus_admin/components_helper.rb b/admin/app/helpers/solidus_admin/components_helper.rb
index c57adba7b6d..855de7ddd26 100644
--- a/admin/app/helpers/solidus_admin/components_helper.rb
+++ b/admin/app/helpers/solidus_admin/components_helper.rb
@@ -5,5 +5,9 @@ module ComponentsHelper
def component(name)
SolidusAdmin::Config.components[name]
end
+
+ def search_filter_params
+ request.params.slice(:q, :page)
+ end
end
end
diff --git a/admin/config/locales/stock_items.en.yml b/admin/config/locales/stock_items.en.yml
index b1ad9f018e2..46a9ef81fd2 100644
--- a/admin/config/locales/stock_items.en.yml
+++ b/admin/config/locales/stock_items.en.yml
@@ -2,3 +2,5 @@ en:
solidus_admin:
stock_items:
title: "Stock Items"
+ update:
+ success: "Stock item was successfully updated."
diff --git a/legacy_promotions/lib/components/admin/solidus_admin/promotion_categories/index/component.rb b/legacy_promotions/lib/components/admin/solidus_admin/promotion_categories/index/component.rb
index b52b1a0f3d2..cbb15d5d810 100644
--- a/legacy_promotions/lib/components/admin/solidus_admin/promotion_categories/index/component.rb
+++ b/legacy_promotions/lib/components/admin/solidus_admin/promotion_categories/index/component.rb
@@ -6,7 +6,11 @@ def model_class
end
def row_url(promotion_category)
- spree.edit_admin_promotion_category_path(promotion_category)
+ edit_path(promotion_category)
+ end
+
+ def edit_path(promotion_category)
+ spree.edit_admin_promotion_category_path(promotion_category, **search_filter_params)
end
def page_actions
@@ -40,7 +44,7 @@ def name_column
{
header: :name,
data: ->(promotion_category) do
- content_tag :div, promotion_category.name
+ link_to promotion_category.name, edit_path(promotion_category), class: "body-link"
end
}
end
@@ -49,7 +53,7 @@ def code_column
{
header: :code,
data: ->(promotion_category) do
- content_tag :div, promotion_category.code
+ link_to promotion_category.code, edit_path(promotion_category), class: "body-link"
end
}
end
diff --git a/legacy_promotions/lib/components/admin/solidus_admin/promotions/index/component.rb b/legacy_promotions/lib/components/admin/solidus_admin/promotions/index/component.rb
index b6fe1730f7e..6c88e2974e7 100644
--- a/legacy_promotions/lib/components/admin/solidus_admin/promotions/index/component.rb
+++ b/legacy_promotions/lib/components/admin/solidus_admin/promotions/index/component.rb
@@ -14,7 +14,11 @@ def search_url
end
def row_url(promotion)
- spree.admin_promotion_path(promotion)
+ edit_path(promotion)
+ end
+
+ def edit_path(promotion)
+ spree.edit_admin_promotion_path(promotion, **search_filter_params)
end
def page_actions
@@ -63,14 +67,16 @@ def columns
{
header: :name,
data: ->(promotion) do
- content_tag :div, promotion.name
+ link_to promotion.name, edit_path(promotion), class: "body-link"
end
},
{
header: :code,
data: ->(promotion) do
- count = promotion.codes.count
- (count == 1) ? promotion.codes.pick(:value) : t('spree.number_of_codes', count:)
+ link_to edit_path(promotion), class: "body-link" do
+ count = promotion.codes.count
+ (count == 1) ? promotion.codes.pick(:value) : t('spree.number_of_codes', count:)
+ end
end
},
{
diff --git a/promotions/lib/components/admin/solidus_promotions/promotion_categories/index/component.rb b/promotions/lib/components/admin/solidus_promotions/promotion_categories/index/component.rb
index 53d675ed3ed..96b9586134d 100644
--- a/promotions/lib/components/admin/solidus_promotions/promotion_categories/index/component.rb
+++ b/promotions/lib/components/admin/solidus_promotions/promotion_categories/index/component.rb
@@ -6,7 +6,11 @@ def model_class
end
def row_url(promotion_category)
- solidus_promotions.edit_admin_promotion_category_path(promotion_category)
+ edit_path(promotion_category)
+ end
+
+ def edit_path(promotion_category)
+ solidus_promotions.edit_admin_promotion_category_path(promotion_category, **search_filter_params)
end
def page_actions
@@ -40,7 +44,7 @@ def name_column
{
header: :name,
data: ->(promotion_category) do
- content_tag :div, promotion_category.name
+ link_to promotion_category.name, edit_path(promotion_category), class: "body-link"
end
}
end
@@ -49,7 +53,7 @@ def code_column
{
header: :code,
data: ->(promotion_category) do
- content_tag :div, promotion_category.code
+ link_to promotion_category.code, edit_path(promotion_category), class: "body-link"
end
}
end
diff --git a/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb b/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb
index 8416e5d343c..cffcb847aba 100644
--- a/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb
+++ b/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb
@@ -63,13 +63,13 @@ def columns
{
header: :name,
data: ->(promotion) do
- link_to promotion.name, row_url(promotion)
+ link_to promotion.name, row_url(promotion), class: "body-link"
end
},
{
header: :code,
data: ->(promotion) do
- link_to solidus_promotions.admin_promotion_promotion_codes_path(promotion), title: t(".codes") do
+ link_to solidus_promotions.admin_promotion_promotion_codes_path(promotion), title: t(".codes"), class: "body-link" do
count = promotion.codes.count
(count == 1) ? promotion.codes.pick(:value) : t("spree.number_of_codes", count: count)
end