-
Notifications
You must be signed in to change notification settings - Fork 132
[Dynamic Dashboard] Improvements to the custom range selection logic #11510
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
The changes allow for showing the date picker when no custom range is saved.
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
@@ -861,11 +861,11 @@ object AppPrefs { | |||
|
|||
fun getActiveStatsTab() = getString(DeletablePrefKey.ACTIVE_STATS_GRANULARITY) | |||
|
|||
fun setActiveTopPerformersGranularity(selectionName: String) { | |||
fun setActiveTopPerformersTab(selectionName: String) { |
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 renaming was done just for consistency, the term granularity
doesn't apply to tabs anymore after introducing the custom range.
@@ -102,8 +107,6 @@ class DashboardTopPerformersViewModel @AssistedInject constructor( | |||
) | |||
}.asLiveData() | |||
|
|||
private val customRange = customDateRangeDataStore.dateRange.asLiveData() |
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.
The LiveData here wasn't observed anywhere, which means it always had the value
as null
, and it caused a bug where opening the date picker doesn't show the current custom range.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #11510 +/- ##
============================================
- Coverage 40.83% 40.82% -0.02%
Complexity 5180 5180
============================================
Files 1070 1070
Lines 62310 62327 +17
Branches 8499 8502 +3
============================================
Hits 25444 25444
- Misses 34578 34595 +17
Partials 2288 2288 ☔ View full report in Codecov by Sentry. |
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.
Looking good 👍
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Closes: #11509
Description
This PR fixes the logic of the custom range in the top performers card, the logic is as follows now:
When selecting the custom ranges dropdown entry, if a custom range has already been saved, it will be used directly; otherwise, the date picker will be shown.
The PR also fixes an issue where dismissing the date picker would not cancel the change to the "Custom Range" entry.
Testing instructions
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.