-
Notifications
You must be signed in to change notification settings - Fork 14k
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(native-filters): Time native filter #12992
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12992 +/- ##
===========================================
+ Coverage 53.06% 67.08% +14.02%
===========================================
Files 489 491 +2
Lines 17314 28947 +11633
Branches 4482 0 -4482
===========================================
+ Hits 9187 19419 +10232
- Misses 8127 9528 +1401
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
cc: @junlincc |
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 native filter changes look good, but I refer the review of time picker changes to @zhaoyongjie .
Hi @simcha90 |
� Conflicts: � superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.tsx � superset-frontend/src/dashboard/components/nativeFilters/types.ts � superset-frontend/src/dashboard/components/nativeFilters/utils.ts
onChange: (timeRange: string) => void; | ||
onTimeRangeChange?: (textValue?: string, timeRange?: string) => void; |
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.
onChange
and onTimeRangeChange
seem to have the same function, can we merge these props?
response?.json?.result?.until || '', | ||
); | ||
const { since = '', until = '' } = response?.json?.result || {}; | ||
const timeRangeString = buildTimeRangeString(since, until); |
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.
NEED to double check here.
timeRangeString
is Absolute time range
.
eg:
if today is 2021-2-8, then last day
, generate "2021-02-07 : 2021-02-08".
when the 2021-3-8, then last day
generate "2021-03-07 : 2021-03-08"
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.
need double check
@simcha90 thanks for taking over the project! really appreciate you work tested and the basic functionality is working, can not fully test until the filter is connected to the indicator. @zhaoyongjie we should either skip the time column select or pre-select dttm column for your user, or simply narrow it down to show date column only in select dropdown.
Screen.Recording.2021-02-08.at.7.17.12.AM.mov |
@villebro @simcha90 @zhaoyongjie what is the scope of this PR? |
@junlincc I think scope of this PR - is ability to set TimeFilter as native filter and also set default value for it. All other additional features should be implemented in other PRs, and can be done in different times after this PR will be merged, because this PR is base PR for all other features. cc @villebro |
Hi, @simcha90, @villebro, @junlincc The implementation of this PR still needs to be considered. Now the filter passed by the native filter to each chart is the |
const metadata = new ChartMetadata({ | ||
name: t('Time range filter plugin'), | ||
description: 'Custom time filter plugin', | ||
behaviors: [Behavior.NATIVE_FILTER], |
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.
it can be also CROSS_FILTER
<Styles width={width}> | ||
<DateFilterControl | ||
value={value} | ||
name="" |
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.
one nit:
could we set a default name for DateFilterControl
?
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.
LGTM, thanks ville.
LGTM! ✅ |
* Add Time Filter component * Improve Time Filter component * Fix import errors * Display Time Filter * Remove console logs * Change Control Panel * Remove unnecessary files * Use time range override * test: fix tests * feat: re run pipeline * fix: fix some case for Time filter * fix: merge with master * use original time range * fix height * add cross filter behavior * apply filters on initialization * add applied filter to overrides * add unit tests for merge_extra_form_data Co-authored-by: Agata Stawarz-Pastewska <[email protected]> Co-authored-by: Ville Brofeldt <[email protected]>
* master: (30 commits) refactor(native-filters): decouple params from filter config modal (first phase) (apache#13021) fix(native-filters): set currentValue null when empty (apache#13000) Custom superset_config.py + secret envs (apache#13096) Update http error code from 400 to 403 (apache#13061) feat(native-filters): add storybook entry for select filter (apache#13005) feat(native-filters): Time native filter (apache#12992) Force pod restart on config changes (apache#13056) feat(cross-filters): add cross filters (apache#12662) fix(explore): Enable selecting an option not included in suggestions (apache#13029) Improves RTL configuration (apache#13079) Added a note about the ! prefix for breaking changes to CONTRIBUTING.md (apache#13083) chore: lock down npm to v6 (apache#13069) fix: API tests, make them possible to run independently again (apache#13076) fix: add config to disable dataset ownership on the old api (apache#13051) add required * indicator to message content/notif method (apache#12931) fix: Retroactively add granularity param to charts (apache#12960) fix(ci): multiline regex in change detection (apache#13075) feat(style): hide dashboard header by url parameter (apache#12918) fix(explore): pie chart label bugs (apache#13052) fix: Disabled state button transition time (apache#13008) ...
SUMMARY
This PR is continue of @agatapst PR: #12946
Here description of ☝️ PR:
In addition this PR fix some edge cases.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION