fix: Fix "View in SQLLab" bug (#12086)

This commit is contained in:
Hugh A. Miles II 2020-12-16 21:59:46 -05:00 committed by GitHub
parent 08b3ebea5e
commit 655834b25c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -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),
};