diff --git a/admin/app/components/solidus_admin/ui/table/component.html.erb b/admin/app/components/solidus_admin/ui/table/component.html.erb index 69a155cd66d..4d8cc5345c1 100644 --- a/admin/app/components/solidus_admin/ui/table/component.html.erb +++ b/admin/app/components/solidus_admin/ui/table/component.html.erb @@ -137,11 +137,12 @@ <%= "data-sortable-animation-value=#{@sortable.animation}" if @sortable&.animation %> > <% @data.rows.each do |row| %> + <% rowUrl = @data.url&.call(row) %> + class="border-b border-gray-100 last:border-0 <%= 'hover:bg-gray-50 cursor-pointer' if rowUrl %> <%= 'bg-gray-15 text-gray-700' if @data.fade&.call(row) %>" + <% if rowUrl %> data-action="click-><%= stimulus_id %>#rowClicked" - data-<%= stimulus_id %>-url-param="<%= @data.url.call(row) %>" + data-<%= stimulus_id %>-url-param="<%= rowUrl %>" <%= "data-sortable-url=#{@sortable.url.call(row)}" if @sortable&.url %> <% end %> > diff --git a/admin/app/components/solidus_admin/ui/table/component.js b/admin/app/components/solidus_admin/ui/table/component.js index 66837d4ce75..fc516f62187 100644 --- a/admin/app/components/solidus_admin/ui/table/component.js +++ b/admin/app/components/solidus_admin/ui/table/component.js @@ -103,7 +103,7 @@ export default class extends Controller { if (this.modeValue === "batch") { this.toggleCheckbox(event.currentTarget) - } else { + } else if (event.params.url) { const url = new URL(event.params.url, "http://dummy.com") const params = new URLSearchParams(url.search) const frameId = params.get('_turbo_frame')