mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
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:
@@ -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')
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user