feat(native-filters): Add defaultValue for Native filters modal#12199
feat(native-filters): Add defaultValue for Native filters modal#12199villebro merged 23 commits intoapache:masterfrom
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.
|
junlincc
left a comment
There was a problem hiding this comment.
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 |
superset-frontend/src/dashboard/components/nativeFilters/CascadePopover.tsx
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
| }; | ||
| column: string; | ||
| defaultValue: string; | ||
| defaultValue: any; |
There was a problem hiding this comment.
Should this be CurrentFilterState?
There was a problem hiding this comment.
explained in bottom comment 👇 :)
| defaultValue: any; | ||
| currentValue?: any; |
There was a problem hiding this comment.
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:
Selectto choose filter type (now supports onlySelectfilter andRangefilter)SuperChartthat renders appropriate Native filter as default value selectordefaultValueQueriesto keep updatedqueriesDatathat will passed toSuperChartdefaultValueFormDatato keep updated form data that will passedSuperChartcurrentStatetonativeFilters.filtersStatein redux to correct save and updatedefaultValuesfor resetAll case and otherssetExtraFormDatahook upgraded to passcurrentStateFlows:
Reset allshould return to default valuesBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-01-28.at.17.12.04.mov
TEST PLAN
Rangefilter (it should be fixed in other PR)ADDITIONAL INFORMATION