-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[dashboard] pass dashboard filters to share chart url in dropdown #7642
[dashboard] pass dashboard filters to share chart url in dropdown #7642
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7642 +/- ##
=======================================
Coverage 65.57% 65.57%
=======================================
Files 435 435
Lines 21754 21754
Branches 2394 2394
=======================================
Hits 14266 14266
Misses 7367 7367
Partials 121 121
Continue to review full report at Codecov.
|
So is the |
Not exactly. For Dashboard components, For FilterBox viz, Besides |
158fa7c
to
fc33529
Compare
All this is somewhat confusing (not because of your PR! was confusing before). Ideally we clarify the prop names / split them into many, or at least adding some comments to the code with the things you just mentioned. |
fc33529
to
2f79a85
Compare
// All the filter_box's state in this dashboard | ||
// When dashboard is first loaded into browser, | ||
// its value is from preselect_filters that dashboard owner saved in dashboard's meta data | ||
// When user start interactive with dashboard, it will be user picked values from any filter_box |
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.
typo interactive
=> interacting
superset/assets/src/chart/Chart.jsx
Outdated
// original selected values for FilterBox viz | ||
// so that FilterBox can pre-populate selected values | ||
// only affect UI control | ||
origSelectedValues: PropTypes.object, |
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.
How about initialFilters
so we know at least it is related to filters
?
On a side note, is this field only used by filter_box
?
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.
I verified and only table
and filter_box
use this filters
field from ChartProps
.
In a follow up thought, initialValues
might be a better name (use values
from your initial idea to make it sounds more open to other vis and
initialto shorten the
origSelected` part)
Hmm. or initialState
.
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.
vote for initialValues
LGTM. Have a few small comments. |
Once this PR is in I can work on updating the |
2f79a85
to
ab87f36
Compare
) (cherry picked from commit f3091c5)
…ache#7642) (cherry picked from commit 5079b5d)
CATEGORY
Choose one
SUMMARY
In dashboard, we allow user to share chart, which is a shorten url which carried current dashboard filters state, and chart's parent tab information (if it has one). But currently, dashboard's selected filters values are not included in the shorten url.
I found in dashboard's component, we used
filters
props for dashboard's selected filters state. But forChart
component, we usedfilters
props to carry the values for the current filter_box, so that current filter_box will pre-populate selected values.Solution:
filter
prop should be assigned at the right place.TEST PLAN
CI and manual test
REVIEWERS
@michellethomas @etr2460 @kristw @williaster