From 6eea966d07a9ffc68cb95fdbaef35c0acf9b3be0 Mon Sep 17 00:00:00 2001 From: hughhhh Date: Wed, 16 Dec 2020 19:48:07 -0500 Subject: [PATCH] fix view in sqllab issue --- .../src/SqlLab/components/TabbedSqlEditors.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx index f0f6d4859f404..fe8b5d0d7554a 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx @@ -116,8 +116,15 @@ class TabbedSqlEditors extends React.PureComponent { } // merge post form data with GET search params + // Hack: this data should be comming from getInitialState + // but for some reason this data isn't being passed properly through + // the reducer. + const appContainer = document.getElementById('app'); + const bootstrapData = JSON.parse( + appContainer?.getAttribute('data-bootstrap') || '{}', + ); const query = { - ...this.props.requestedQuery, + ...bootstrapData.requested_query, ...URI(window.location).search(true), };