-
Notifications
You must be signed in to change notification settings - Fork 137
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
[Woo POS][Non Simple product types] Fetch variations list #12910
Conversation
…or all items list screens like products, variations ...etc
…or all items list screens like products, variations ...etc
…ew model is initiated.
…ew model is initiated.
…ns view model is initiated.
…iations view model is initiated.
…ceRefresh set to true when variations view model is initiated.
…call is successful.
…properties when the API call is successful.
…properties when the API call is successful.
…g property set to true when pull to refreshed
…g property set to true when pull to refreshed
…property set to true when pull to refreshed
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
…nto issue/12844-fetch-variations # Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsScreen.kt # WooCommerce/src/main/res/values/strings.xml
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #12910 +/- ##
============================================
- Coverage 39.63% 39.59% -0.04%
- Complexity 5932 5956 +24
============================================
Files 1261 1267 +6
Lines 72862 73179 +317
Branches 9965 10048 +83
============================================
+ Hits 28879 28976 +97
- Misses 41414 41629 +215
- Partials 2569 2574 +5 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@@ -0,0 +1,343 @@ | |||
package com.woocommerce.android.ui.woopos.home.items | |||
|
|||
import androidx.compose.foundation.ExperimentalFoundationApi |
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.
Most of this changes are because of extracting it into different file.
.collect { event -> | ||
when (event) { | ||
is WooPosVariationsViewModel.WooPosVariationEvents.PaginationError -> { | ||
snackbarHostState.showSnackbar( |
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.
We may change from showing snack bar into a card with retry button. If we decide on that, I will raise a separate PR for it.
…nto issue/12844-fetch-variations
…nto issue/12844-fetch-variations # Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItem.kt # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/variations/WooPosVariationsScreen.kt # WooCommerce/src/main/res/values/strings.xml
…nto issue/12844-fetch-variations # Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsScreen.kt
… price is set to 0
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.
LGTM!
|
||
@OptIn(ExperimentalFoundationApi::class) | ||
@Composable | ||
fun ItemsList( |
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.
💡 n.p. In store management we follow the convention of singular+List (e.g. itemList
) or just plural (with "s", without "List"). Maybe it's worth renaming?
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.
Done: 4e26906
Closes: #12844
NOTE: I've extracted the UI in the products screen into separate file which is the cause for many line changes.
Description
This PR fetches variations list and displays on the variations screen.
It makes use of existing
VariationsListHandler
class for fetching variations.Testing information
Testing Variations list
Testing Variations pagination
Testing Variations pagination error
Testing Variations fetch error
The tests that have been performed
Tested all the above scenario listed in both light and dark modes on emulator.
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: