Files
superset2/superset/assets/javascripts/SqlLab/index.jsx
Maxime Beauchemin 366ecefbaa Bumping the JS libs to fix the build (#2616)
* bumping the js libs

* New linting rules

* More linting

* More

* Done linting

* npm >=4.5.0

* Bumping node

* Tweaking the build

* Fixing the damn build

* Fixing the apps
2017-04-13 15:04:09 -07:00

33 lines
1022 B
JavaScript

import React from 'react';
import { render } from 'react-dom';
import { createStore, compose, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import thunkMiddleware from 'redux-thunk';
import { getInitialState, sqlLabReducer } from './reducers';
import { initEnhancer } from '../reduxUtils';
import { initJQueryAjaxCSRF } from '../modules/utils';
import App from './components/App';
import { appSetup } from '../common';
import './main.css';
appSetup();
initJQueryAjaxCSRF();
const appContainer = document.getElementById('app');
const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
const state = Object.assign({}, getInitialState(bootstrapData.defaultDbId), bootstrapData);
const store = createStore(
sqlLabReducer, state, compose(applyMiddleware(thunkMiddleware), initEnhancer()));
// jquery hack to highlight the navbar menu
$('a:contains("SQL Lab")').parent().addClass('active');
render(
<Provider store={store}>
<App />
</Provider>,
appContainer,
);