-
Notifications
You must be signed in to change notification settings - Fork 132
[Dynamic Dashboard] Stock card 19.0 beta feedback updates #11730
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
Conversation
* trunk: Update WooPosCartCartRepositoryTest Remove unused imports Update WooPosCartViewModelTest Don't crash the app on payment failure Satisfy detekt's complaints Clean up code Start payment flow from totals screen Fix order creation API request Show only simple products that have price Start collect payment flow from totals screen Pass order id to totals screen
@@ -58,7 +58,10 @@ class DashboardProductStockViewModel @AssistedInject constructor( | |||
emit(Loading(status)) | |||
productStockRepository.fetchProductStockReport(status, refresh.isForced) | |||
.fold( | |||
onSuccess = { emit(ViewState.Success(it, status)) }, | |||
onSuccess = { | |||
val sortedProductStockItems = it.sortedBy { item -> item.stockQuantity } |
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.
Essentially adding the same sorting logic as in iOS:
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #11730 +/- ##
============================================
- Coverage 40.28% 40.28% -0.01%
Complexity 5333 5333
============================================
Files 1133 1133
Lines 65148 65151 +3
Branches 9006 9006
============================================
Hits 26243 26243
- Misses 36504 36507 +3
Partials 2401 2401 ☔ View full report in Codecov by Sentry. |
@@ -189,7 +189,7 @@ private fun ProductStockLoading( | |||
} | |||
|
|||
@Composable | |||
private fun ProductReviewsCardContent( | |||
private fun ProductStockCardContent( |
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.
Good catch!
modifier = Modifier.weight(1f), | ||
modifier = Modifier | ||
.weight(1f) | ||
.padding(end = 8.dp), |
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 job @hafizrahman. I added just one minor change before merging. |
Part of: #11718
Description
This PR adds the following:
Steps to reproduce
Product thumbnail
DashboardProductStockCard
on line 278 and hack in a longer name for the product. I usedtext = product.name + product.name + product.name + product.name + product.name + product.name,
Product sorting
I think just check the code and smoke test that the result is always ordered correctly, also by changing various product's stocks and re-checking the card.