-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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): Adhoc dashboard native filters #22168
base: master
Are you sure you want to change the base?
feat(native-filters): Adhoc dashboard native filters #22168
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22168 +/- ##
==========================================
+ Coverage 60.48% 70.35% +9.86%
==========================================
Files 1931 1958 +27
Lines 76236 78450 +2214
Branches 8568 8783 +215
==========================================
+ Hits 46114 55192 +9078
+ Misses 28017 21126 -6891
- Partials 2105 2132 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
A few first pass comments. I love this, this really improves adhoc analysis in the dashboard view ❤️
superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/filters/components/Adhoc/AdhocFilterPlugin.tsx
Outdated
Show resolved
Hide resolved
looking forward to it being released. |
Thank you for the PR @cccs-RyanK! How will this filter behave considering inter filter features such as Is the popup arrow pointing to the correct direction when the filter bar is horizontal? We need to consider the scenario where the filter is displayed in the bar in which case the arrow should point up and the case where the filter is displayed in the dropdown in which case the arrow should point to the right. I agree with @yousoph's points. |
Thank you for the feedback @yousoph! I agree with the first point I can remove the plus button for sure. For the name maybe "advanced", "extra", or "custom" filters? Not sure if any of those fit. |
@cccs-RyanK Just to be more clear about the above point. There's a feature called Values depend on other filters (check this PR's video) which allows you to establish an hierarchy between filters. One example is when you have a State and City filters and you want to change the City's values depending on the selected value in State. This all works because there's a clear definition of the dataset and column when creating a filter. When you introduce a SQL filter, we don't know what's the column (or even if the SQL returns a column), so I'm wondering how all the features that depend on this definition will work. I think we need to at least disable these features when working with a SQL filter. If I defined the State filter as a SQL filter, then it shouldn't appear as one of the options in Values depend on other filters when configuring the City filter. |
@michael-s-molina thank you for the clarification! Yes I think that feature will need to be disabled on the SQL filter based on the reasons you mentioned. As for scoping, the SQL filter should work the same as other filters such as Time column filter which only specifies the dataset and not a specific column. Lastly, I also agree about the horizontal filter bar I will test and adjust the popover so that it pops below instead of to the right in that case. Aiming to work on this soon. |
@cccs-RyanK , @michael-s-molina Is there a permission to control this. I would want this available to Gamma roles and admins will have the normal add/edit filter. |
Hey @michaelkovatt! I am not sure I understand all your question. For the first part no there was no permissions in place for this type of filter as of the last update, but for the second part what exactly is the behaviour you were thinking? You would like to configure it so that only certain roles have access to this type of filter? |
@cccs-RyanK , yes you are right. Only need to enable this for some roles. Also, wanted to know if there is any timeline for the feature to go as part of next release? |
I have no timeline on finishing it at the moment since I have been using this feature in my fork of superset for quite a while. Your comment the other day brought my attention back to this and I would like to finally push to include it in a future release. One major wall that I ran into was the design of the component when in horizontal view. In the screenshot I have included below you can see that adding a few filters expands the height too much. If you added enough filters you could eventually expand the filterbar to take up the whole screen. I am looking for input/ideas on adjusting it |
Setting this to draft, but please make it ready for review when it's... ready for review. :) |
be2e686
to
db8b382
Compare
@cccs-RyanK is CCCS still interested in reopening this PR? This request comes up from time to time, and this would cover a bunch of use cases that are impossible with the current set of filters.. |
…ome cases, people want a time filter only on filter box, withoutspecifying dimensions (filters), this allows that(cherry picked from commit e39b169)
db8b382
to
71ef25e
Compare
SUMMARY
Our users really like the functionality of the adhoc filters in the explore view and were interested in something similar for for dashboard filtering. Anything that can be done with an adhoc filter native filter can be done with the other filter types and vice versa, but in order to filter by any given column the user has to either:
In this PR we added a new native filter type that reuses the adhoc filter component from the explore view to allow for more complex filtering to easily be done in a dashboard.
This solution provides the user with a lot of power and flexibility in dashboards, which is why it is behind a feature flag for now.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
adhoc-native-filters-demo_p1.mp4
adhoc-native-filters-demo_p2.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION