-
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
feat(native-filters): Add defaultValue for Native filters modal #12199
Conversation
…erset into filter_type
� Conflicts: � superset-frontend/spec/javascripts/dashboard/components/nativeFilters/ScopingTree_spec.tsx � superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx � superset-frontend/src/dashboard/components/nativeFilters/FilterConfigForm.tsx � superset-frontend/src/dashboard/components/nativeFilters/FilterScope.tsx � superset-frontend/src/dashboard/components/nativeFilters/ScopingTree.tsx � superset-frontend/src/dashboard/components/nativeFilters/state.ts � superset-frontend/src/dashboard/components/nativeFilters/utils.ts
� Conflicts: � superset-frontend/src/dashboard/components/nativeFilters/FilterConfigForm.tsx � superset-frontend/src/dashboard/components/nativeFilters/FilterConfigModal.tsx
closes #12713 |
Codecov Report
@@ Coverage Diff @@
## master #12199 +/- ##
==========================================
- Coverage 63.23% 61.88% -1.36%
==========================================
Files 1021 535 -486
Lines 50145 20037 -30108
Branches 5204 5242 +38
==========================================
- Hits 31708 12399 -19309
+ Misses 18222 7424 -10798
+ Partials 215 214 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Thank you Simcha for the PR! a few issues found in this branch but not in master
- when i open the dashboard modal, screen below is what i see. have to click "+" to expand
- reset button doesn't work
- after selecting filter type, default select dropdown does not show. "No Results" but there actually are options
@simcha90 you have rebased right?
� Conflicts: � superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx
fix: Reset all fixed
@junlincc Hi fixed your notes (about 3. it works for me, but may it was fixed by my other changes). About multiple values, it can be good idea but I think in other PR in order to not increase size of this one, because implementing of this feature caused some cascading changes in other parts of code, so it have now XL size :) cc @villebro |
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.
First pass comments.
superset-frontend/src/dashboard/components/nativeFilters/CascadePopover.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/types.ts
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/state.ts
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/state.ts
Outdated
Show resolved
Hide resolved
dataset: { | ||
value: number; | ||
label: string; | ||
}; | ||
column: string; | ||
defaultValue: string; | ||
defaultValue: any; |
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.
Should this be CurrentFilterState
?
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.
explained in bottom comment 👇 :)
defaultValue: any; | ||
currentValue?: any; |
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.
Same here
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's value that we are passing to the native filter, so it should be currentValue
together with defaultValue
and not currentState
according current apis
I think may be we need to discuss in future if we want to render some things like Allow multiple selection
checkbox inside of native filter chart so it should be really changed to currentState but for now all filters working only with currentValue
* master: (23 commits) feat(explore): clear search on dataset change (apache#12909) chore: remove SIP-38 feature flag (apache#12894) fix: Config for dataset health check (apache#12906) fix(chart): allow null for most query object props (apache#12905) feat: add separate endpoint to fetch function names for autocomplete (apache#12840) chore: add required review on master (apache#12694) fix: comment typo (apache#12898) Migrates Radio component from Bootstrap to AntD. (apache#12738) fix: allow users to reset their passwords (apache#12886) fix(explore): missing select when groupby without metrics (apache#12890) refactor: dbapi exception mapping for dbapi's (apache#12869) feat(style-theme): add support for custom superset themes (apache#12858) chore(lint): fix pre-commit error (apache#12884) refactor(color-schemes): refactor setting of color schemes (apache#12857) feat(native-filters): Add defaultValue for Native filters modal (apache#12199) feat(release): add github token to changelog script (apache#12872) fix(menu): always show settings dropdown (apache#12877) Migrates Label component from Bootstrap to AntD. (apache#12774) [Helm] Automate datasource import (apache#10771) build: Skip loading example data from configs in CI (apache#12610) ...
SUMMARY
Add support for defaultValue in Native Filters Config Modal per filter type.
Changes:
Select
to choose filter type (now supports onlySelect
filter andRange
filter)SuperChart
that renders appropriate Native filter as default value selectordefaultValueQueries
to keep updatedqueriesData
that will passed toSuperChart
defaultValueFormData
to keep updated form data that will passedSuperChart
currentState
tonativeFilters.filtersState
in redux to correct save and updatedefaultValues
for resetAll case and otherssetExtraFormData
hook upgraded to passcurrentState
Flows:
Reset all
should return to default valuesBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-01-28.at.17.12.04.mov
TEST PLAN
Range
filter (it should be fixed in other PR)ADDITIONAL INFORMATION