-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-676 DataView custom empty view #22118
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
Generated by 🚫 Danger |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22118-9ca05d1 | |
Commit | 9ca05d1 | |
Direct Download | wordpress-prototype-build-pr22118-9ca05d1.apk |
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.
Pull Request Overview
This PR introduces customizable empty views for the DataView component to replace the hardcoded Subscribers empty view that was incorrectly shown for all DataView implementations. The changes allow each DataView implementation to specify its own empty state message and image while providing a sensible default.
- Added a customizable
DataViewEmptyView
class with default generic empty state text and image - Updated
SubscribersViewModel
to override the empty view with subscriber-specific content - Modified DataView screen components to accept and use the custom empty view parameter
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
strings.xml | Adds default empty message string resource for DataView |
DataViewViewModel.kt | Introduces DataViewEmptyView class with default empty state configuration |
SubscribersViewModel.kt | Overrides empty view with subscriber-specific message and image |
DataViewScreen.kt | Updates composable to accept and use custom empty view parameter |
SubscribersActivity.kt | Passes the view model's empty view to the DataView screen |
ApplicationPasswordsListActivity.kt | Passes the view model's empty view to the DataView screen |
WordPress/src/main/java/org/wordpress/android/ui/dataview/DataViewViewModel.kt
Outdated
Show resolved
Hide resolved
|
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22118-9ca05d1 | |
Commit | 9ca05d1 | |
Direct Download | jetpack-prototype-build-pr22118-9ca05d1.apk |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22118 +/- ##
=======================================
Coverage 39.43% 39.43%
=======================================
Files 2149 2149
Lines 101872 101872
Branches 15604 15604
=======================================
Hits 40177 40177
Misses 58126 58126
Partials 3569 3569 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This was a great catch! LGTM!
Closes CMM-676
Prior to this PR, when the list of items in a
DataView
was empty we would always show the empty view text for the Subscribers feature. This meant that when viewing application passwords, the user would be told "There are no subscribers" if the password list was empty.Luckily, the password list should never be empty, but this still needed to be addressed. So this PR resolves this by using a default generic empty view which can be overriden.
Here's the default empty view:
And here's the empty view overriden for Subscribers: