-
Notifications
You must be signed in to change notification settings - Fork 14.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
feat(explore): time picker enhancement #11418
Conversation
08713fd
to
1650811
Compare
Codecov Report
@@ Coverage Diff @@
## master #11418 +/- ##
==========================================
- Coverage 66.71% 63.02% -3.69%
==========================================
Files 967 970 +3
Lines 47543 47937 +394
Branches 4650 4736 +86
==========================================
- Hits 31716 30212 -1504
- Misses 15706 17538 +1832
- Partials 121 187 +66
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Is this changing the behavior of the current function? We have to be mindful of the thousands of charts out there that have been built based on the current behavior. |
6ad0d89
to
9a90a4d
Compare
99d0105
to
10c7c07
Compare
1aa6fb3
to
4b98832
Compare
bf30bb1
to
e05ae53
Compare
Tested it today, this feature enhancement is so AWESOME!! MANY MANY THANKS @zhaoyongjie |
488d346
to
6e82c0b
Compare
many thanks to @kristw @ktmud @graceguo-supercat for reviewing this PR! 🙏🙏 |
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.
Yeah, CI is green! Merging with the understanding that these followups have been planned:
- Break down control to child components
- Extract frontend utilities to a separate module and add unit tests
- Change modal to popover (potentially)
- Improve typescript typing
- Remove the validate button
- Extract Python helpers to a separate file
Again, thanks for the great work!
@zhaoyongjie Could you also confirm whether this new control work well with existing charts (i.e. any charts with existing custom time range filters)? I hope we have some test cases for them, but it's not obvious by just looking at the PR. |
hi @ktmud, This new control is fully compatible with the original time range string. I'll test it manually right now, on every chart |
|
* upstream/master: (55 commits) feat(explore): time picker enhancement (apache#11418) feat: update alert/report icons and column order (apache#12081) feat(explore): metrics and filters controls redesign (apache#12095) feat(alerts/reports): add refresh action (apache#12071) chore: add latest tag action (apache#11148) fix(reports): increase crontab size and alert fixes (apache#12056) Small typo fix in Athena connection docs (apache#12099) feat(queries): security perm simplification (apache#12072) feat(databases): security perm simplification (apache#12036) feat(dashboards): security permissions simplification (apache#12012) feat(logs): security permissions simplification (apache#12061) chore: Remove unused CodeModal (apache#11972) Fix typescript error (apache#12074) fix: handle context-dependent feature flags in CLI (apache#12088) fix: Fix "View in SQLLab" bug (apache#12086) feat(alert/report): add 'not null' condition option to modal (apache#12077) bumping superset ui to 15.18 and deckgl to 0.3.2 (apache#12078) fix: Python dependencies in apache#11499 (apache#12079) reset active tab on open (apache#12048) fix: improve import flow UI/UX (apache#12070) ...
SUMMARY
This PR introduces the new Explore Time Picker input modal that allows quick selection of various time ranges and granularities. It is an enhancement of the existing time picker in Explore, including preservation of the current library dateutil.parse, parsedatetime and adding new libraries pyparsing, python-holidays. User now can easily set any time range by either selecting a pre-defined range(e.g. Last 24 hours, Previous Calendar Month)or creating a date range formula for more specific range definition (e.g. from HOLIDAY("Christmas", dateadd(datetime("2019"), 1, year)) to DATEADD(DATETIME("TODAY"), -13, DAY))
Miro link: https://miro.com/app/board/o9J_kiQxGIU=/
Roadmap item: apache-superset/superset-roadmap#34
Features include
DATETIME("2020-03-01 12:00:00")
DATETIME("now")
DATETIME("last year")
Dateadd([datetime], [integer], [dateunit])
dateunit = (YEAR | QUARTER | MONTH | WEEK | DAY | HOUR | MINUTE | SECOND)
DATEADD(DATETIME("TODAY"), -13, DAY)
DATEADD(DATETIME("2020-03-01"), 2, DAY)
Datetrunc([datetime], [dateunit])
Lastday([datetime], [dateunit])
dateunit = (YEAR | MONTH | WEEK)
Python-holidays library(https://github.com/dr-prodigy/python-holidays)
HOLIDAY("new year")
HOLIDAY("christmas", datetime("2019"))
HOLIDAY("christmas", dateadd(datetime("2019"), 1, year))
HOLIDAY("christmas", datetime("2 years ago"))
HOLIDAY("Easter Monday", datetime("2019"), "UK")
Last Modal
Previous Modal
Custom Modal
Advanced Modal
TEST PLAN
adding unit test for this function
ADDITIONAL INFORMATION