-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MSD - Handle Single Dashboard Card Error in UI #15893
Conversation
Temporarily points to FluxC draft PR handling error inside dashboard cards.
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APKs: |
…d class This is done to allow enclosing error card within parent sealed class for today's stats in a future commit.
unauthorized, jetpack_disconnected, jetpack_disabled errors are not shown as they're irrecoverable on pull to refresh.
To test that unauthorized, jetpack_disconnected, jetpack_disabled errors are not shown and that cards with empty state (default values) are also shown when these error exist.
Since this PR only handles errors within a card, the existing mocked response JSON file is modified to include only errors instead of creating a new JSON file specifically for errors. This fixes lint issue complaining about unused mocked resource file. Anyone using the mocked JSON file after this point should appropriately modify the file content.
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.
👋 @ashiagr !
I have reviewed and tested this PR as per the instructions, everything works as expected, great job! 🌟 🌟
I have left one suggestion (💡) and some minor (🔍) comments for you to consider
...main/java/org/wordpress/android/ui/mysite/cards/dashboard/error/ErrorWithinCardViewHolder.kt
Outdated
Show resolved
Hide resolved
...n/java/org/wordpress/android/ui/mysite/cards/dashboard/todaysstats/TodaysStatsCardBuilder.kt
Outdated
Show resolved
Hide resolved
...n/java/org/wordpress/android/ui/mysite/cards/dashboard/todaysstats/TodaysStatsCardBuilder.kt
Outdated
Show resolved
Hide resolved
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.
@ashiagr Thanks for making the changes as per my suggestions. 🙌 👍
…le-card-error-state # Conflicts: # WordPress/src/main/res/raw/mocked_site_dashboard_cards.json # build.gradle
…le-card-error-state # Conflicts: # build.gradle
…le-card-error-state
As discussed on Slack, merging it now. |
Parent #15750
References pbArwn-3ny-p2 (
if one card fails - error inside card
state and title copy change in this comment)References wordpress-mobile/WordPress-FluxC-Android#2251
This PR handles errors within
Posts
andToday's Stats
cards using mocked data.Note: As
unauthorised
,jetpack_disconnected
andjetpack_disabled
errors are irrecoverable (see p1643789176707579-slack-C0290FLA0RM), these error are filtered out from displaying. The condition for showing these error cards can be modified in the future in the corresponding builder classes. The tests ensure that no card (neither with error nor with data) is displayed when these errors are returned for that card type.To test:
Prerequisites
wpcom
site.My Site
->App Settings
->Debug Settings
.MySiteDashboardPhase2FeatureConfig
is to set to on.Notice that no card exists for
Today's Stats
andPosts
in theMy Site Dashboard
with the given mocked JSON.[Optional, covered in unit tests] Replace mocked JSON
error
node with different supported error types and reinstall the app:Notice that these errors are never shown.
Replace mocked JSON
error
node with a fallbackgeneric_error
and reinstall the app. Notice that a generic error within a card is displayed as shown. We can further discuss showing fallback errors in this Slack thread (p1644303679654909/1643829887.600439-slack-C0290FLA0RM). An error within a card, when shown, is tracked as follows (see pbArwn-2zs-p2#comment-4731). Tracking can be tested by enablingMy Site
->App Settings
->Privacy settings
->Collect information
and switching between sites.Merge Instructions
This PR is still in draft mode as it depends on the previous unmerged
Today's Card
UI with mocked data and the linked draftFluxC
PR requiring changes after the endpoint is live. Please wait to merge the PR until mentioned PRs are merged todevelop
.Regression Notes
Potential unintended areas of impact
Cards should not be displayed with default values (like 0 likes, 0 views) when an error exists.
What I did to test those areas of impact (or what existing automated tests I relied on)
Manually tested.
What automated tests I added (or what prevented me from doing so)
Add unit tests.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.