jileeon opened a new pull request, #23344:
URL: https://github.com/apache/superset/pull/23344

   ### SUMMARY
   Add 'urlParams' option to pass query parameters to embedded dashboard(for 
SQL templating)
   
   There are 2 representative cases it can handle:
   1. General Case: Passes all query parameters on main page. In this case, 
'dashboardConfig' and 'filterConfigUrlParams' can be affected by query 
parameters on main page.
   2. Special Case: If 'urlParams' specified on dashboardUiConfig option, 
passes explicit query parameters in 'urlParams' only. So 'dashboardConfig' and 
'filterConfigUrlParams' cannot be affected by query parameters on main page, 
and it can restrict query parameters only necessary for Superset Dashboard. In 
addition, It can replace an existing embedded dashboard to a new one using 
updated query parameters - An embedded dashboard will be recreated when UI 
values change on parent page and they should be applied to the embedded 
dashboard.
   
   My website provides datepicker UI component on parent page. If its value 
changes, Replace an embedded dashboard(used old value) to a new one(used new 
value). As far as I know, Destroying the old one and Creating a new one is the 
best. I tried refresh embedded dashboard by the message channel between the 
main page and iframe - it's complex
   
   I'm using like the example below. 
   ```html
   <script>
     var embedded_dashboard;
     
     var init = function () {
         embedded_dashboard && embedded_dashboard.unmount();  // Destroy 
existing dashboard
         
         // Replace with a new one
         supersetEmbeddedSdk.embedDashboard({
             // ...
             dashboardUiConfig: {
                 urlParams: {
                     foo: 'new_val_1',
                     bar: 'new_val_2',
                     // ...
                 },
             },
         })
             .then(switchboard => {
                 embedded_dashboard = switchboard; 
             });
     }
   </script>
   ```
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   ### TESTING INSTRUCTIONS
   
   ### ADDITIONAL INFORMATION
   


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