fix: migrate return reasons list to new DataTable component#14916
fix: migrate return reasons list to new DataTable component#14916TheSeydiCharyyev wants to merge 4 commits intomedusajs:developfrom
Conversation
|
@TheSeydiCharyyev is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 3e9276b The changes in this PR will be included in the next version bump. This PR includes changesets to release 76 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
...-reasons/return-reason-list/components/return-reason-list-table/return-reason-list-table.tsx
Show resolved
Hide resolved
|
@claude review this |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| await mutateAsync(returnReason.id, { | ||
| onSuccess: () => { | ||
| toast.success(t("returnReasons.delete.successToast")) |
There was a problem hiding this comment.
Missing label interpolation in delete success toast
Medium Severity
The t("returnReasons.delete.successToast") call is missing the { label } interpolation parameter. The translation string expects {{label}} (Return reason "{{label}}" was successfully deleted.), so the toast will render with a raw placeholder or empty string instead of the actual reason label. The old code correctly passed { label }. This was likely copied from the refund reasons page, where the translation string doesn't use interpolation — but the return reasons one does. The returnReason variable is available in the enclosing handleDelete callback and its label property needs to be passed.
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
Addressed the review feedback:
|
|
Thank you for your contribution! After reviewing this PR, we need a few things addressed before we can move forward: Required changes:
The implementation itself looks solid — it correctly mirrors the pattern already used by the Refund Reasons page, the PR template is complete, and the linked issue (#14812) is valid and open. |
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |


What
Migrates the Return Reasons settings page from the legacy
_DataTablecomponent to the newerDataTablecomponent, matching the pattern already used by the Refund Reasons page.Why
The Return Reasons page uses the legacy
_DataTablewithnoHeader: true, which hides search, column sorting, and column headers. The Refund Reasons page already uses the modernDataTablecomponent with full functionality. This inconsistency was reported in #14812.How
use-return-reason-table-columns.tsx— ReplacedcreateColumnHelperfrom@tanstack/react-tablewithcreateDataTableColumnHelperfrom@medusajs/ui. Added column headers,sorting, and
DescriptionCellfor the description column.return-reason-list-table.tsx— Replaced_DataTable+ manual header with the newDataTablecomponent. Added built-in search, heading, empty states, and inline action menu(edit/delete) using
columnHelper.action().return-reasons.tsx— AddeduseDeleteReturnReasonLazyhook (lazy variant whereidis passed tomutationFn) to support the new inline delete action pattern.Testing
Fixes #14812
Note
Low Risk
Low risk UI refactor that swaps table components and rewires row actions; main risk is regressions in list interactions (search/sort/navigation/delete) due to the new DataTable API and mutation wiring.
Overview
Migrates the Return Reasons settings list from the legacy
_DataTableto the newerDataTable, restoring built-in header UI including search, empty states, and column sorting.Updates return-reason columns to use
createDataTableColumnHelperwith translated headers and a dedicatedDescriptionCell, and moves edit/delete into an inline row action column (with prompt + toasts and explicit navigation).Adds
useDeleteReturnReasonLazy(id passed at call time) and removes the olduseDeleteReturnReasonActionhelper, while keeping query invalidation behavior for list/detail refresh after deletes.Written by Cursor Bugbot for commit fe789c0. This will update automatically on new commits. Configure here.