Query Search Page (#1122)

* Query search page under SQL Lab tab

* Modifications based on comments

* Hash

* Added spec and endpoint test with modifications
based on second round comments

* Changed permission menu in https://github.com/airbnb/caravel/pull/1095/files
This commit is contained in:
vera-liu
2016-09-23 16:13:18 -07:00
committed by GitHub
parent 98902599ff
commit d5c5c0d6ac
13 changed files with 345 additions and 144 deletions

View File

@@ -4,61 +4,24 @@ 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[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);
$('a:contains("SQL Lab")').parent().addClass('active');
render(
<Provider store={store}>
<ReduxedApp />
<App />
</Provider>,
document.getElementById('app')
);