-
Notifications
You must be signed in to change notification settings - Fork 136
[Woo POS][Refunds] Issue Refund Dialog - refundable items #15039
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
base: woomob-1801-add-the-issue-refund-button
Are you sure you want to change the base?
[Woo POS][Refunds] Issue Refund Dialog - refundable items #15039
Conversation
- Update `WooPosIssueRefundDialog` to replace placeholder content with a list of selectable line items, displaying images, quantities, prices, and totals. - Add `itemsSelectedLabel` to `WooPosOrdersState` and update `WooPosOrdersViewModel` to calculate and pass the selection count. - Integrate the updated dialog into `WooPosOrdersScreen` passing the order line items. - Add string resources for the refund selection screen headers and labels.
- Remove `qtyAndUnitPrice` property from `LineItemRow` in `WooPosOrdersState`. - Remove unit price calculation logic from `WooPosOrdersViewModel`. - Remove UI elements displaying quantity and unit price in `WooPosIssueRefundDialog` and `WooPosOrdersDetails`.
- Add content description to the "Select All" checkbox for better accessibility. - Add content description to individual line item checkboxes using the item name. - Refactor hardcoded column width into a `COLUMN_WIDTH` constant. - Switch `LazyColumn` usage from `items` to `itemsIndexed` for safer divider logic.
…ue refund dialog - Update `WooPosOrdersViewModelTest` to include a mock for `woopos_orders_items_selected` string resource. - Add a new test case `given order with multiple line items, when onIssueRefundButtonClicked called, then itemsSelectedLabel is correctly formatted` to verify the label formatting. - Verify the `resourceProvider` interaction in the existing `onIssueRefundButtonClicked` test.
Generated by 🚫 Danger |
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.
Pull request overview
This PR introduces a refund dialog UI for the WooCommerce POS orders feature. It creates a new user interface that allows selecting items from an order to issue refunds, though the actual refund processing functionality is not yet implemented in this iteration.
Key changes:
- Created new refund dialog with item selection UI displaying line items, amounts, and tax columns
- Removed
qtyAndUnitPricefield fromLineItemRowdata class, simplifying the order details display - Added string resources for the refund dialog labels and headers
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| WooPosIssueRefundDialog.kt | Implements new refund dialog UI with item list, checkboxes, and continue button |
| WooPosOrdersViewModel.kt | Adds logic to populate dialog state with item count label; removes unit price calculation from line item mapping |
| WooPosOrdersState.kt | Updates IssueRefund dialog state to include itemsSelectedLabel; removes qtyAndUnitPrice from LineItemRow |
| WooPosOrdersScreen.kt | Moves dialog rendering to top-level component; updates dialog to pass line items and label |
| WooPosOrdersDetails.kt | Removes quantity/unit price display from order product items |
| WooPosDialogWrapper.kt | Adds status bar and navigation bar padding to dialog wrapper |
| strings.xml | Adds new string resources for refund dialog (item selection label, amount, tax headers) |
| WooPosOrdersViewModelTest.kt | Adds test coverage for items selected label formatting with mocked resource strings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosOrdersViewModel.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosOrdersScreen.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosIssueRefundDialog.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosIssueRefundDialog.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosIssueRefundDialog.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosIssueRefundDialog.kt
Outdated
Show resolved
Hide resolved
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## woomob-1801-add-the-issue-refund-button #15039 +/- ##
=============================================================================
- Coverage 38.58% 38.53% -0.05%
+ Complexity 10300 10299 -1
=============================================================================
Files 2161 2161
Lines 122658 122819 +161
Branches 16912 16915 +3
=============================================================================
+ Hits 47325 47328 +3
- Misses 70533 70689 +156
- Partials 4800 4802 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… items" This reverts commit d77e355.
- Create `WooPosRefundViewModel` to handle data loading and state management for the refund dialog. - Add `WooPosGetRefundableItems` to calculate available refundable quantities and expand line items into individual units. - Introduce `WooPosRefundState` to model the UI state (Loading, Content, Error, NoRefundableItems). - Update `WooPosIssueRefundDialog` to use the new ViewModel and render based on the current state, removing dependency on passed-in line items. - Modify `WooPosOrdersScreen` and `WooPosOrdersViewModel` to pass only `orderId` when triggering the refund dialog. - Add `WooPosRefundableItem` model for individual refundable units.
Wrap the item name text composable in a Column and add a new WooPosText to display the item quantity below the name.
🤖 Test Failure AnalysisYour tests failed. Claude has analyzed the failures - check the annotation for details. |
Summary
This PR introduces the create refund dialog's basic UI in
Woo POS > Ordersscreen.Note: This PR focuses on the basic UI implementation.
💡 Note:
Test Steps
Figma specs: DK955L5K0bTfkjrHTBLmqo-fi-303_20712
Images/gif