mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
[sqllab] config item for SQLLAB_DEFAULT_DBID (#1793)
This commit is contained in:
committed by
GitHub
parent
a95cd71456
commit
aeda5bd260
@@ -4,7 +4,7 @@ require('bootstrap');
|
||||
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { initialState, sqlLabReducer } from './reducers';
|
||||
import { getInitialState, sqlLabReducer } from './reducers';
|
||||
import { enhancer } from '../reduxUtils';
|
||||
import { createStore, compose, applyMiddleware } from 'redux';
|
||||
import { Provider } from 'react-redux';
|
||||
@@ -15,8 +15,12 @@ import App from './components/App';
|
||||
|
||||
require('./main.css');
|
||||
|
||||
const appContainer = document.getElementById('app');
|
||||
const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
|
||||
const state = Object.assign({}, getInitialState(bootstrapData.defaultDbId), bootstrapData);
|
||||
|
||||
let store = createStore(
|
||||
sqlLabReducer, initialState, compose(applyMiddleware(thunkMiddleware), enhancer()));
|
||||
sqlLabReducer, state, compose(applyMiddleware(thunkMiddleware), enhancer()));
|
||||
|
||||
// jquery hack to highlight the navbar menu
|
||||
$('a:contains("SQL Lab")').parent().addClass('active');
|
||||
@@ -25,5 +29,5 @@ render(
|
||||
<Provider store={store}>
|
||||
<App />
|
||||
</Provider>,
|
||||
document.getElementById('app')
|
||||
appContainer
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user