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.

Improve returns & refunds UX

Damian Legawiecd9541c183302
diff --git a/admin/app/views/spree/admin/refund_reasons/index.html.erb b/admin/app/views/spree/admin/refund_reasons/index.html.erb
index 0b1366453c..ee06f19980 100644
--- a/admin/app/views/spree/admin/refund_reasons/index.html.erb
+++ b/admin/app/views/spree/admin/refund_reasons/index.html.erb
@@ -16,7 +16,7 @@
</thead>
<tbody id="<%= plural_resource_name(Spree::RefundReason).to_s.parameterize.underscore %>">
<% @collection.each do |refund_reason| %>
- <tr id="<%= spree_dom_id refund_reason %>" data-hook="named_type_row">
+ <tr id="<%= spree_dom_id refund_reason %>">
<td class="align-center">
<%= refund_reason.name %>
</td>
diff --git a/admin/app/views/spree/admin/reimbursement_types/_form.html.erb b/admin/app/views/spree/admin/reimbursement_types/_form.html.erb
index 23a57fdfa1..45af14ff28 100644
--- a/admin/app/views/spree/admin/reimbursement_types/_form.html.erb
+++ b/admin/app/views/spree/admin/reimbursement_types/_form.html.erb
@@ -8,7 +8,7 @@
<%- if @reimbursement_type.new_record? %>
<div class="form-group">
<%= f.label :type, Spree.t(:type) %>
- <%= f.select :type, options_for_select(Spree::ReimbursementType::KINDS.map { |kind| [kind.demodulize.humanize, kind] }), { include_blank: false}, { class: 'custom-select' } %>
+ <%= f.select :type, options_for_select(Spree::ReimbursementType::KINDS.map { |kind| [kind.demodulize.titleize, kind] }), { include_blank: false}, { class: 'custom-select' } %>
<%= f.error_message_on :type %>
</div>
<% end %>
diff --git a/admin/app/views/spree/admin/reimbursement_types/index.html.erb b/admin/app/views/spree/admin/reimbursement_types/index.html.erb
index 78804c72c9..8cc1b6d70c 100644
--- a/admin/app/views/spree/admin/reimbursement_types/index.html.erb
+++ b/admin/app/views/spree/admin/reimbursement_types/index.html.erb
@@ -6,25 +6,33 @@
<% if @reimbursement_types.any? %>
<div class="table-responsive card-lg p-0">
- <table class="table" id='listing_reimbursement_types' data-hook>
+ <table class="table" id='listing_reimbursement_types'>
<thead class="text-muted">
<tr>
<th><%= Spree.t(:name) %></th>
<th><%= Spree.t(:type) %></th>
+ <th><%= Spree.t(:status) %></th>
+ <th><%= Spree.t(:mutable) %></th>
<th class="actions"></th>
</tr>
</thead>
<tbody>
<% @reimbursement_types.each do |reimbursement_type| %>
- <tr id="<%= spree_dom_id reimbursement_type %>">
- <td class="align-center">
+ <tr id="<%= spree_dom_id reimbursement_type %>" data-controller="row-link">
+ <td class="w-40 align-center cursor-pointer" data-action="click->row-link#openLink">
<%= reimbursement_type.name.humanize %>
</td>
- <td>
+ <td class="w-30 cursor-pointer" data-action="click->row-link#openLink">
<code><%= reimbursement_type.type.demodulize %></code>
</td>
- <td class="actions">
- <%= link_to_edit reimbursement_type, no_text: true if can?(:edit, reimbursement_type) %>
+ <td class="w-10 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= active_badge(reimbursement_type.active, label: Spree.t(reimbursement_type.active? ? :active : :inactive)) %>
+ </td>
+ <td class="w-10 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= active_badge(reimbursement_type.mutable) %>
+ </td>
+ <td class="actions w-10">
+ <%= link_to_edit reimbursement_type, no_text: true, data: { row_link_target: :link } if can?(:edit, reimbursement_type) %>
</td>
</tr>
<% end %>
diff --git a/admin/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb b/admin/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb
index 978f271c3b..5d3ea797ff 100644
--- a/admin/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb
+++ b/admin/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb
@@ -1,5 +1,5 @@
<% content_for(:page_title) do %>
- Returns & Refunds
+ <%= Spree.t(:returns) %> & <%= Spree.t(:refunds) %>
<% end %>
<% content_for(:page_tabs) do %>