-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Transaction Refund Datagrid to GridTable #4855
Migrate Transaction Refund Datagrid to GridTable #4855
Conversation
🦋 Changeset detectedLatest commit: 880a9b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
…-to-dashboardtable
…-to-dashboardtable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, overall LGTM 👌
...TransactionRefundPage/components/OrderTransactionRefundTable/OrderTransactionRefundTable.tsx
Outdated
Show resolved
Hide resolved
src/orders/views/OrderTransactionRefundCreate/OrderTransactionRefundCreate.tsx
Outdated
Show resolved
Hide resolved
const toAdd = linesToRefund.reduce<OrderGrantRefundUpdateLineAddInput[]>((acc, line, ix) => { | ||
if (typeof line.quantity === "number" && line.quantity > 0) { | ||
acc.push({ | ||
id: data.order!.lines[ix].id, | ||
quantity: line.quantity, | ||
reason: line.reason, | ||
}); | ||
} | ||
|
||
return acc; | ||
}, []) ?? []; | ||
return acc; | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: It seems like we can just filter
and/or map
on linesToRefund
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cloud11PL I needed to change back to reduce here because using filter & map changes the indices I rely upon to get proper line IDs
...TransactionRefundPage/components/OrderTransactionRefundTable/OrderTransactionRefundTable.tsx
Outdated
Show resolved
Hide resolved
src/orders/views/OrderTransactionRefundCreate/OrderTransactionRefundCreate.tsx
Outdated
Show resolved
Hide resolved
…-to-dashboardtable
src/orders/components/OrderTransactionRefundPage/OrderTransactionRefundPage.tsx
Outdated
Show resolved
Hide resolved
...TransactionRefundPage/components/OrderTransactionReasonModal/OrderTransactionReasonModal.tsx
Outdated
Show resolved
Hide resolved
.../OrderTransactionRefundPage/components/OrderTransactionRefundTable/AlreadyRefundedHelper.tsx
Outdated
Show resolved
Hide resolved
...TransactionRefundPage/components/OrderTransactionRefundTable/OrderTransactionRefundTable.tsx
Outdated
Show resolved
Hide resolved
…-to-dashboardtable
.../OrderTransactionRefundPage/components/OrderTransactionRefundTable/AlreadyRefundedHelper.tsx
Outdated
Show resolved
Hide resolved
...sactionRefundPage/components/OrderTransactionRefundTable/OrderTransactionRefundTableLine.tsx
Outdated
Show resolved
Hide resolved
* (wip) Migrate Transaction Refund Datagrid to GridTable * Add changeset * UI improvements & reason per line modal * Fix strict mode * Refactor * CR Refactor * Improve modal UI * Strict mode fix * Fix navigation * CR improvements * Fix qtyToRefund == maxQtyToRefund * Split components & handle ellipsis better * Fix incorrect handling of refund lines * Fix refs type errors
What type of PR is this?
Related Issues or Documents
Usage Instructions, Screenshots, Recordings
Have you written tests?
[Optional] Description
Enable this feature with:
Go to order with at least one transaction, and create a new refund