stevetracvc opened a new issue #16580:
URL: https://github.com/apache/superset/issues/16580


   When you share a dashboard (Copy Dashboard URL, Share dashboard by email, or 
click the link icon next to a tab, etc), the native filter values and 
deprecated filter values are exported with the shortened link. However, cross 
filters and the new experimental embedded filters (eg, Range Filter, Select 
Filter, etc) are NOT exported.
   
   ### Expected results
   
   When you share a dashboard's state with someone, you'd expect ALL parts of 
the state to be shared. This would include every filter's setting
   
   ### Actual results
   
   The Cross Filter-type filter values are not exported
   
   #### How to reproduce the bug
   
   1. Add Native filters and Range Filter or Select Filter boxes to a 
dashboard. Also set a table to emit cross filters.
   2. Set several filter values, on Native Filters and the embedded Range 
Filter, as well as cross filters for a table.
   3. Click on the dashboard's three dots and choose "Copy dashboard URL"
   4. Paste this URL into a new browser tab
   5. Note that the Native Filter values are populated, but the Range Filter, 
Select Filter, and emitted Cross Filter values are not
   
   ### Environment
   
   - superset version: master, as of Aug 27 (last commit was 
62d8ab7f9c044e2887de794484c30c2108213e0b)
   using the Docker version, so all other software is as-is from the Docker 
configs
   - any feature flags active:
       "DASHBOARD_NATIVE_FILTERS": True,
       "DASHBOARD_CROSS_FILTERS": True,
       "DASHBOARD_FILTERS_EXPERIMENTAL": True,
       "ENABLE_EXPLORE_DRAG_AND_DROP": False,
       "ENABLE_TEMPLATE_PROCESSING": True,
       "DYNAMIC_PLUGINS": True,
       "DASHBOARD_RBAC": True,
   
   ### Checklist
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   A little discussion here: 
https://apache-superset.slack.com/archives/C016B3LG5B4/p1629643453183200
   
   The generated URLs are shortened, but prior to getting shortened, they're 
basically a bunch of URL parameters. I dug around and found that the Native 
Filters and old (deprecated) filter boxes are properly exported, but in file 
src/dashboard/actions/hydrate.js is what loads the preselect_filters and 
native_filters from the URL parameters. There's a section on setting up cross 
filters, but not loading any values for them from URL params. It also doesn't 
do anything for things like Range Filters. 
   
   I tried changing line 194, which only looks for "filter_box" elements, to 
instead include "filter_*" so that it would catch the range filters. It 
generated this example set of URL parameters:
   
   
`preselect_filters={"998":{"COLUMN_NAME":"All"},"1104":{"ANOTHER_COLUMN_NAME":{"filters":[{"col":"ANOTHER_COLUMN_NAME","op":">=","val":93.75}]}}}&native_filters=(NATIVE_FILTER-XofC8k3la:(extraFormData:(),filterState:(),id:NATIVE_FILTER-XofC8k3la,ownState:()))
   `
   element 998 is an old-school (apparently deprecated) filter, element 1104 is 
a range filter (cross filter), and I had no value set for my one native filter. 
This link doesn't actually apply the set values to element 1104.
   
   
   
   I might be able to fix this myself, if I get some assistance on where to 
look. These filters seem to apply similar to cross filters rather than native 
filters, so I'm guessing I need to look there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to