Refund by items: Refund items list - Step 2#1622
Refund by items: Refund items list - Step 2#1622AmandaRiu merged 85 commits intofeature/refund-by-items-masterfrom
Conversation
# Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundFragment.kt # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundViewModel.kt
# Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundFragment.kt # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundViewModel.kt # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/RefundsModule.kt
…list # Conflicts: # WooCommerce/build.gradle # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundViewModel.kt
|
Thanks for the review @AmandaRiu! I've addressed your comments in code and some answers to your questions here:
It was supposed to be a flag for showing an indefinite snackbar but it's not really useful so I removed it.
Fixed.
Fixed.
Please ignore this for now. The amount text view is actually a button from the original design, which we decided to remove. The actual amount dialog is implemented in one of the following PRs and eventually disabled in the last one. So the correct color can be verified then.
I'm not sure a number picker view inside a context pop up menu would work. It's scrollable and the pop up view would need to be large enough so that it'd be easy to change the value. I guess the whole thing could be converted into a list but if there were a lot of items it could become very long. We can discuss it further if you like but if do decide to change it, let's do it in a separate PR. What do you think? Ready for another round of review :). |
|
@0nko finished another round. Made a comment in the code about
|
Sort of, because not all orders contain discounts. But after thinking about it, it doesn't make sense to show discounts in refunds because items already have the discount included in the price -- this is done by the API (for example, if you have an order of 2 items for $10 each and a discount for $2, the actual price for an item in the refunds would show $9). The user might be confused why the discount amount isn't applied in the total summary, so I removed that line altogether.
Yeah. We've discovered the API doesn't support shipping refunds. But I already implemented the feature by that time. Because of this, #1623 does show it (a stub) so that it can be reviewed. It's then hidden in the next PR. I kept the code so that it can be used once the API supports it.
I've implemented this in #1633 to avoid unnecessary refactoring. |
…list # Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/RefundSummaryFragment.kt # build.gradle
I totally agree. It confused me. I was referring to the discount being hidden even for an order that has a discount applied - it unhides itself after you select an item for a refund.
👍
👍 |
NM - I see you have this removed now. |

This PR adds the a new refund-by-items Fragment, layout and the item list implementation with all the necessary infrastructure. It was not possible to break this down further because there are some SavedState merge conflict resolutions that needed to be included.
This PR updates minor versions of a couple of dependencies -- most notably the Navigation component. This makes it possible to use the new
navGraphViewModels()ViewModel scope, which ties the VM lifecycle to that of a subgraph. You can see it in action here. The SavedState injections needed to be updated to reflect this.On the bright side, it's now possible to test the number picker dialog by tapping on the item count view. The refund by items functionality is not working, but you can select the number of items to refund and the refund subtotal and taxes are calculated. The
Select allbutton works, as well.By the way, I'm not sure what's going on with
ciklintfailing (ktlintpasses on my machine), but the Step 3 PR is passing so just ignore it here and it'll get fixed when that one gets merged.Note: #1621 must be merged before this!