Skip to content
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): Use datasets in dashboard as default options for native filters #14374

Merged

Conversation

kgabryje
Copy link
Member

SUMMARY

When user creates a native filter, display only datasets used in current dashboard as options in dataset picker. When user starts typing, send a query to backend for other available datasets.
E.g. there are datasets "a_dataset", "b_dataset" and "c_dataset". If the current dashboard uses datasets "a_dataset" and "b_dataset", only those 2 will be displayed in dataset picker in native filters modal. When user starts typing "c..." in dataset picker, "c_dataset" will be fetched from backend and displayed as an option.
If a dashboard uses only 1 dataset, that dataset will be used as a default initial value in the dataset picker. If the dashboard uses more datasets, no default value will be used.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2021-04-27.at.14.24.44.mov

TEST PLAN

ADDITIONAL INFORMATION

CC @villebro @junlincc @ktmud

@kgabryje kgabryje requested review from villebro and a team April 27, 2021 12:26
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - small nit

({ datasources }) => datasources,
);

console.log({ loadedDatasets });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log({ loadedDatasets });

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! 😄

@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Apr 27, 2021
@junlincc
Copy link
Member

@kgabryje awesome!!

@pull-request-size pull-request-size bot added size/M and removed size/S labels Apr 27, 2021
@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #14374 (d734760) into master (20ab086) will decrease coverage by 0.17%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14374      +/-   ##
==========================================
- Coverage   77.15%   76.98%   -0.18%     
==========================================
  Files         954      954              
  Lines       48189    48197       +8     
  Branches     6002     6006       +4     
==========================================
- Hits        37180    37103      -77     
- Misses      10812    10898      +86     
+ Partials      197      196       -1     
Flag Coverage Δ
javascript 71.69% <88.88%> (-0.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 81.14% <87.50%> (-9.29%) ⬇️
...nd/src/components/SupersetResourceSelect/index.tsx 70.96% <100.00%> (+0.96%) ⬆️
...nd/src/filters/components/Select/transformProps.ts 18.18% <0.00%> (-72.73%) ⬇️
...c/filters/components/Select/SelectFilterPlugin.tsx 13.20% <0.00%> (-71.70%) ⬇️
...ontend/src/filters/components/Select/buildQuery.ts 33.33% <0.00%> (-66.67%) ⬇️
...ters/FiltersConfigModal/FiltersConfigForm/state.ts 48.07% <0.00%> (-26.93%) ⬇️
...tersConfigModal/FiltersConfigForm/DefaultValue.tsx 88.88% <0.00%> (-11.12%) ⬇️
...mponents/nativeFilters/FiltersConfigModal/utils.ts 65.78% <0.00%> (-2.64%) ⬇️
...ConfigModal/FiltersConfigForm/FilterScope/utils.ts 98.43% <0.00%> (-1.57%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20ab086...d734760. Read the comment docs.

@villebro villebro merged commit 41ccebc into apache:master Apr 27, 2021
amitmiran137 pushed a commit that referenced this pull request Apr 28, 2021
…r native filters (#14374)

* Use defaultOptions in dataset picker

* Remove console log

* Temporarily skip failing test

(cherry picked from commit 41ccebc)
@rusackas rusackas added the demo label May 12, 2021
@junlincc junlincc removed the demo label May 28, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…r native filters (apache#14374)

* Use defaultOptions in dataset picker

* Remove console log

* Temporarily skip failing test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels dashboard:native-filters Related to the native filters of the Dashboard release:note size/M test:case v1.2 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants