mirror of
https://github.com/apache/superset.git
synced 2026-05-08 01:15:46 +00:00
Linted all, refactored VisualizeModal out
This commit is contained in:
@@ -8,51 +8,52 @@ import QueryLink from './QueryLink';
|
||||
// CSS
|
||||
import 'react-select/dist/react-select.css';
|
||||
|
||||
class LeftPane extends React.Component {
|
||||
render() {
|
||||
let queryElements;
|
||||
if (this.props.workspaceQueries.length > 0) {
|
||||
queryElements = this.props.workspaceQueries.map((q) => <QueryLink query={q} />);
|
||||
} else {
|
||||
queryElements = (
|
||||
<Alert bsStyle="info">
|
||||
Use the save button on the SQL editor to save a query into this section for
|
||||
future reference
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="panel panel-default LeftPane">
|
||||
<div className="panel-heading">
|
||||
<h6 className="m-r-10">
|
||||
<i className="fa fa-flask" />
|
||||
SQL Lab <Label bsStyle="danger">ALPHA</Label>
|
||||
</h6>
|
||||
</div>
|
||||
<div className="panel-body">
|
||||
<div>
|
||||
<h6>
|
||||
<span className="fa-stack">
|
||||
<i className="fa fa-database fa-stack-lg"></i>
|
||||
<i className="fa fa-search fa-stack-1x"></i>
|
||||
</span> Saved Queries
|
||||
</h6>
|
||||
<div>
|
||||
{queryElements}
|
||||
</div>
|
||||
<hr />
|
||||
<Button onClick={this.props.actions.resetState.bind(this)}>
|
||||
Reset State
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
const LeftPane = (props) => {
|
||||
let queryElements;
|
||||
if (props.workspaceQueries.length > 0) {
|
||||
queryElements = props.workspaceQueries.map((q) => <QueryLink query={q} />);
|
||||
} else {
|
||||
queryElements = (
|
||||
<Alert bsStyle="info">
|
||||
Use the save button on the SQL editor to save a query into this section for
|
||||
future reference
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div className="panel panel-default LeftPane">
|
||||
<div className="panel-heading">
|
||||
<h6 className="m-r-10">
|
||||
<i className="fa fa-flask" />
|
||||
SQL Lab <Label bsStyle="danger">ALPHA</Label>
|
||||
</h6>
|
||||
</div>
|
||||
<div className="panel-body">
|
||||
<div>
|
||||
<h6>
|
||||
<span className="fa-stack">
|
||||
<i className="fa fa-database fa-stack-lg"></i>
|
||||
<i className="fa fa-search fa-stack-1x"></i>
|
||||
</span> Saved Queries
|
||||
</h6>
|
||||
<div>
|
||||
{queryElements}
|
||||
</div>
|
||||
<hr />
|
||||
<Button onClick={props.actions.resetState.bind(this)}>
|
||||
Reset State
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
LeftPane.propTypes = {
|
||||
workspaceQueries: React.PropTypes.array,
|
||||
actions: React.PropTypes.object,
|
||||
};
|
||||
|
||||
LeftPane.defaultProps = {
|
||||
workspaceQueries: [],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user