Files
superset2/superset/assets/javascripts/SqlLab/components/QueryHistory.jsx
Maxime Beauchemin e055e6d2c2 Fixing PropTypes warning messages (#2670)
* Fixing PropTypes warning message

React recently started warning on the upcoming deprecation of
React.PropTypes, the new approach is to use the `prop-types`
npm package instead.

* Fixing the tests
2017-04-24 17:39:57 -07:00

34 lines
716 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { Alert } from 'react-bootstrap';
import QueryTable from './QueryTable';
const propTypes = {
queries: PropTypes.array.isRequired,
actions: PropTypes.object.isRequired,
};
const QueryHistory = (props) => {
if (props.queries.length > 0) {
return (
<QueryTable
columns={[
'state', 'started', 'duration', 'progress',
'rows', 'sql', 'output', 'actions',
]}
queries={props.queries}
actions={props.actions}
/>
);
}
return (
<Alert bsStyle="info">
No query history yet...
</Alert>
);
};
QueryHistory.propTypes = propTypes;
export default QueryHistory;