-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix(native-filters): remove hard-coded default time range #15015
fix(native-filters): remove hard-coded default time range #15015
Conversation
3592acd
to
550399f
Compare
550399f
to
6771a83
Compare
/testenv up FEATURE_DASHBOARD_NATIVE_FILTERS=true |
@junlincc Ephemeral environment spinning up at http://35.163.111.252:8080. Credentials are |
@villebro thanks for the PR! looks like hard coded time range are removed, but filter is not affecting the query. please see video, when i do set time range to last week, dashboard has no change. Screen.Recording.2021-06-08.at.11.32.17.AM.mov |
😱 Thanks for testing - will look into this asap and add a test. |
@junlincc it's applying fine for me: It appears that the COVID dataset doesn't have a temporal column. Which raises the question, we should probably not show a time filter (or time column filter for that matter) if there are no temporal columns available in the target dataset. However, this same problem applies to Filter Box as well, so I propose leaving that to a later PR. |
sounds good. does #15068 make sense? cc @kgabryje @michael-s-molina |
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.
thanks again for the fix! product sign-off ✅ @rusackas ready for ya
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.
Nice, LGTM.
Notice that this default behavior may produce some slow queries for some database(missing time partition column)
Ephemeral environment shutdown and build artifacts deleted. |
🏷2021.23 |
* fix(native-filters): use default for time range from explore * fix tests (cherry picked from commit 8aaa603)
* fix(native-filters): use default for time range from explore * fix tests
* fix(native-filters): use default for time range from explore * fix tests
* fix(native-filters): use default for time range from explore * fix tests
SUMMARY
Currently the time range native filter defaults to "Last week" despite the new default being "No Filter" as introduced in #14661. This PR removes all references to "Last week" and leaves the time range value unset unless explicitly set. Other changes:
filterState
(which the application has control over)defaultValue
(this is now fully handled by the application)BEFORE
When leaving the default value unset, the value shows up as "Last week":
AFTER
Now it defaults to "No filter":
When no filter is defined, the filter indicator shows the filter as being unset:
TESTING INSTRUCTIONS
Local testing:
ADDITIONAL INFORMATION