mirror of
https://github.com/apache/superset.git
synced 2026-05-09 09:55:19 +00:00
Linted all, refactored VisualizeModal out
This commit is contained in:
@@ -1,38 +1,36 @@
|
||||
import { Tab, Tabs } from 'react-bootstrap';
|
||||
import QueryLog from './QueryLog';
|
||||
import QueryHistory from './QueryHistory';
|
||||
import ResultSet from './ResultSet';
|
||||
import React from 'react';
|
||||
|
||||
class SouthPane extends React.Component {
|
||||
render() {
|
||||
let results;
|
||||
if (this.props.latestQuery) {
|
||||
if (this.props.latestQuery.state === 'running') {
|
||||
results = (
|
||||
<img className="loading" alt="Loading.." src="/static/assets/images/loading.gif" />
|
||||
);
|
||||
} else if (this.props.latestQuery.state === 'failed') {
|
||||
results = <div className="alert alert-danger">{this.props.latestQuery.msg}</div>;
|
||||
} else if (this.props.latestQuery.state === 'success') {
|
||||
results = <ResultSet showControls query={this.props.latestQuery} />;
|
||||
}
|
||||
} else {
|
||||
results = <div className="alert alert-info">Run a query to display results here</div>;
|
||||
const SouthPane = (props) => {
|
||||
let results;
|
||||
if (props.latestQuery) {
|
||||
if (props.latestQuery.state === 'running') {
|
||||
results = (
|
||||
<img className="loading" alt="Loading.." src="/static/assets/images/loading.gif" />
|
||||
);
|
||||
} else if (props.latestQuery.state === 'failed') {
|
||||
results = <div className="alert alert-danger">{props.latestQuery.msg}</div>;
|
||||
} else if (props.latestQuery.state === 'success') {
|
||||
results = <ResultSet showControls query={props.latestQuery} />;
|
||||
}
|
||||
return (
|
||||
<Tabs bsStyle="pills">
|
||||
<Tab title="Results" eventKey={1}>
|
||||
<div style={{ overflow: 'auto' }}>
|
||||
{results}
|
||||
</div>
|
||||
</Tab>
|
||||
<Tab title="Query Log" eventKey={2}>
|
||||
<QueryLog />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
);
|
||||
} else {
|
||||
results = <div className="alert alert-info">Run a query to display results here</div>;
|
||||
}
|
||||
}
|
||||
return (
|
||||
<Tabs bsStyle="pills">
|
||||
<Tab title="Results" eventKey={1}>
|
||||
<div style={{ overflow: 'auto' }}>
|
||||
{results}
|
||||
</div>
|
||||
</Tab>
|
||||
<Tab title="Query History" eventKey={2}>
|
||||
<QueryHistory />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
);
|
||||
};
|
||||
|
||||
SouthPane.propTypes = {
|
||||
latestQuery: React.PropTypes.object,
|
||||
|
||||
Reference in New Issue
Block a user