-
Notifications
You must be signed in to change notification settings - Fork 135
[Bookings] Error and loading states for Team member filter screen #14980
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: trunk
Are you sure you want to change the base?
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
| bookingsRepository.observeResources().distinctUntilChanged().collect { resources -> | ||
| _uiState.update { current -> current.copy(teamMembers = listOf(TeamMember.any) + resources) } | ||
| _uiState.update { current -> | ||
| current.copy(isLoading = resources.isEmpty(), teamMembers = listOf(TeamMember.any) + resources) |
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.
I had to use isLoading = resources.isEmpty() here because observeResources() returns empty resources when the database is empty.
| Column(modifier = Modifier.fillMaxWidth()) { | ||
| SkeletonView( | ||
| modifier = Modifier | ||
| .size(62.dp, 64.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.
I took these sizes from the sample screen in Figma.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
.../kotlin/com/woocommerce/android/ui/bookings/filter/teammember/BookingTeamMemberFilterPage.kt
Fixed
Show fixed
Hide fixed
0cecaf1 to
d119b59
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #14980 +/- ##
============================================
- Coverage 38.46% 38.45% -0.01%
- Complexity 10233 10236 +3
============================================
Files 2155 2155
Lines 122175 122230 +55
Branches 16818 16826 +8
============================================
+ Hits 46996 47007 +11
- Misses 70412 70456 +44
Partials 4767 4767 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes WOOMOB-1464
Description
This adds handling for loading and error states when fetching team members on the Team Member filter page.
Test Steps
Tip for creating "first load" case
Use
DELETE FROM BookingResourcescommand in "App Inspection → Database Inspector → New Query" tab.Tip for the API error case
Temporarily_hardcode_siteId_for_Bookings_resources_request.patch: Use this patch to break site parameter when fetching resource.
Images/gif
Loading.webm
Error.webm
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.