feat(native-filters): Hide time filters if loaded datasets don't have temporal columns - #15225
Conversation
villebro
left a comment
There was a problem hiding this comment.
LGTM - code looks good and works as expected in testing 👍
|
@kgabryje I don't need to remove the |
|
Oh, gotcha! I hate warnings too 🤣 |
Codecov Report
@@ Coverage Diff @@
## master #15225 +/- ##
==========================================
+ Coverage 77.08% 77.18% +0.09%
==========================================
Files 971 971
Lines 50242 50308 +66
Branches 6498 6140 -358
==========================================
+ Hits 38731 38828 +97
+ Misses 11306 11276 -30
+ Partials 205 204 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
@kgabryje i am scanning dashboards with current master branch. I am not sure what is logic you decide a dataset has "temporal" column, many of our users can check Is Temporal from dataset editor: Could you investigate and test it? |
|
@graceguo-supercat This PR relies on backend functionality added in this PR: #15188 . I can investigate this. |
|
@graceguo-supercat I tested on a few dashboards and I can't reproduce the issue. Case 2: a dashboard with 1 dataset with temporal columns (World Bank's Data), time filters are available Case 3: a dashboard with a dataset which doesn't have temporal columns (Covid Vaccine Dashboard), time filters are unavailable. Case 4: Covid Vaccine Dashboard with manually added temporal column through Edit Dataset modal, time filters are available. |
… temporal columns (apache#15225) * feat(native-filters): Hide time filters if loaded datasets don't have temporal columns * Remove "px" suffixes to fix warnings * Disable an option instead of hiding filter types * Fix tests * Add 2 more tests
… temporal columns (apache#15225) * feat(native-filters): Hide time filters if loaded datasets don't have temporal columns * Remove "px" suffixes to fix warnings * Disable an option instead of hiding filter types * Fix tests * Add 2 more tests
… temporal columns (apache#15225) * feat(native-filters): Hide time filters if loaded datasets don't have temporal columns * Remove "px" suffixes to fix warnings * Disable an option instead of hiding filter types * Fix tests * Add 2 more tests
… temporal columns (apache#15225) * feat(native-filters): Hide time filters if loaded datasets don't have temporal columns * Remove "px" suffixes to fix warnings * Disable an option instead of hiding filter types * Fix tests * Add 2 more tests








SUMMARY
If none of the datasets used by charts on current dashboard have any temporal columns, there's no point in applying Time range, Time column or Time grain filters to them. This PR implements disables selecting those filter types on dashboards without datasets with temporal columns.
Also, there's no point in pre-filtering by time range datasets without temporal columns. This PR implements hiding time range picker pre-filter if current dataset doesn't have temporal columns.
I also removed "px" suffix from "0px" css values to remove linter warnings.
Second part of the related issue (#15068) was excluding charts that use dataset without temporal columns from scope when creating a time filter. We've decided to handle this as a separate issue (#14977). CC @junlincc
Rejected alternatives: hiding time filters instead of disabling options in select button. We decided that it might be confusing for the users if some filter types just "disappeared".
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: see #15068
After:
Case 1: only datasets without temporal columns - time filters disabled, time range pre-filter hidden
https://user-images.githubusercontent.com/15073128/122394612-7589fc80-cf76-11eb-9af4-f3662b71d432.mov
Case 2: only some datasets have temporal columns - time filters enabled, time range pre-filter hidden if a dataset without temporal columns is selected ("threads" dataset has temporal columns, "members_channels_2" doesn't)
https://user-images.githubusercontent.com/15073128/122388521-3eb0e800-cf70-11eb-96b6-ad5f2651bf69.mov
TESTING INSTRUCTIONS
DASHBOARD_NATIVE_FILTERSfeature flagcovid_vaccinesfrom test data)Pre-filter available values. Verify that time range filter shows upADDITIONAL INFORMATION