codepic commented on issue #11113:
URL: 
https://github.com/apache/incubator-superset/issues/11113#issuecomment-702018399


   @villebro I managed to get the filtering working :+1: 
   
   
![image](https://user-images.githubusercontent.com/3933589/94787043-0bbec800-03d2-11eb-82a9-53c8b193b5e2.png)
   
   Below are the relevant changes I needed to do in `superset-frontend`
   
   
![image](https://user-images.githubusercontent.com/3933589/94787383-88ea3d00-03d2-11eb-803e-a36faf1fe6cb.png)
   
   As it seems, the check `form_data.viz_type === 'filter_box'` is hard coded 
so I added my `viz_type` to the check and my plugin started emitting filter 
events correctly.
   
   There's a catch. If I add `filter_box` into the dashboard, the functionality 
breaks and the table only listens to the filters set in the `filter_box` plugin.
   
   However this is not an issue as I can still use multiple custom plugins 
which emit filters and they seem to be working as expected:
   
   
![image](https://user-images.githubusercontent.com/3933589/94789617-6a397580-03d5-11eb-9907-308230c0d4d4.png)
   
   Since hard coding `viz_type` check is not optimal, I would suggest we would 
add a flag to the `form_data` when ever a plugin developer adds the 
`FilterBoxItemControl` into their control panel. Then we can check in 
`dashboardState.js` and `getInitialState.js` that if this flag is set to `true`.
   
   This way plugin developers could start implementing their own filters just 
by adding `FilterBoxItemControl` into their `controlPanel.ts` and using the 
`hooks` provided by superset.
   
   As it currently stands, having custom filtering functionality is impossible 
with Superset without modifying `superset-frontend` yourself.
   
   
   


----------------------------------------------------------------
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.

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