Revert "Query Search Page" (#1186)

This commit is contained in:
vera-liu
2016-09-23 16:28:21 -07:00
committed by GitHub
parent d5c5c0d6ac
commit 551c97112c
13 changed files with 144 additions and 345 deletions
+44 -7
View File
@@ -4,24 +4,61 @@ require('bootstrap');
import React from 'react';
import { render } from 'react-dom';
import * as Actions from './actions';
import TabbedSqlEditors from './components/TabbedSqlEditors';
import QueryAutoRefresh from './components/QueryAutoRefresh';
import Alerts from './components/Alerts';
import { bindActionCreators, createStore } from 'redux';
import { connect, Provider } from 'react-redux';
import { initialState, sqlLabReducer } from './reducers';
import { enhancer } from '../reduxUtils';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import App from './components/App';
require('./main.css');
let store = createStore(sqlLabReducer, initialState, enhancer());
// jquery hack to highlight the navbar menu
$('a:contains("SQL Lab")').parent().addClass('active');
$('a[href="/caravel/sqllab"]').parent().addClass('active');
const App = function (props) {
return (
<div className="App SqlLab">
<div className="container-fluid">
<QueryAutoRefresh />
<Alerts alerts={props.alerts} />
<div className="row">
<div className="col-md-12">
<TabbedSqlEditors />
</div>
</div>
</div>
</div>
);
};
App.propTypes = {
alerts: React.PropTypes.array,
};
function mapStateToProps(state) {
return {
alerts: state.alerts,
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators(Actions, dispatch),
};
}
const ReduxedApp = connect(mapStateToProps, mapDispatchToProps)(App);
render(
<Provider store={store}>
<App />
<ReduxedApp />
</Provider>,
document.getElementById('app')
);