From fd9d5d6820ef19c02d1c58b8512d530a5885cb0a Mon Sep 17 00:00:00 2001 From: Chris Todorov Date: Fri, 28 Mar 2025 15:47:48 -0700 Subject: [PATCH] Use semantic links to edit option types This brings the index component to the new style introduced in https://github.com/solidusio/solidus/pull/6046. Co-authored-by: Nick Van Doorn Co-authored-by: Andrew Stewart --- .../solidus_admin/option_types/index/component.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/admin/app/components/solidus_admin/option_types/index/component.rb b/admin/app/components/solidus_admin/option_types/index/component.rb index 24f6b24e4cf..288931a0fd2 100644 --- a/admin/app/components/solidus_admin/option_types/index/component.rb +++ b/admin/app/components/solidus_admin/option_types/index/component.rb @@ -5,10 +5,6 @@ def model_class Spree::OptionType end - def row_url(option_type) - spree.edit_admin_option_type_path(option_type) - end - def sortable_options { url: ->(option_type) { solidus_admin.move_option_type_path(option_type) }, @@ -55,7 +51,8 @@ def name_column { header: :name, data: ->(option_type) do - content_tag :div, option_type.name + link_to option_type.name, edit_path(option_type), + class: 'body-link' end } end @@ -63,9 +60,11 @@ def name_column def presentation_column { header: :presentation, - data: ->(option_type) do - content_tag :div, option_type.presentation - end + data: ->(option_type) { option_type.presentation } } end + + def edit_path(option_type) + spree.edit_admin_option_type_path(option_type) + end end