etr2460 commented on a change in pull request #14178:
URL: https://github.com/apache/superset/pull/14178#discussion_r614948087
##########
File path: superset-frontend/src/SqlLab/components/QueryHistory.tsx
##########
@@ -17,40 +17,37 @@
* under the License.
*/
import React from 'react';
-import PropTypes from 'prop-types';
import Alert from 'src/components/Alert';
import { t } from '@superset-ui/core';
import QueryTable from './QueryTable';
+import { Query } from '../types';
-const propTypes = {
- queries: PropTypes.array.isRequired,
- actions: PropTypes.object.isRequired,
- displayLimit: PropTypes.number.isRequired,
-};
+interface QueryHistoryProps {
+ queries: Query[];
+ actions: Record<string, unknown>;
+ displayLimit: number;
+}
-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}
- displayLimit={props.displayLimit}
- />
- );
- }
- return <Alert type="info" message={t('No query history yet...')} />;
-};
-QueryHistory.propTypes = propTypes;
+const QueryHistory = (props: QueryHistoryProps) =>
+ props.queries.length > 0 ? (
+ <QueryTable
+ columns={[
+ 'state',
+ 'started',
+ 'duration',
+ 'progress',
+ 'rows',
+ 'sql',
+ 'output',
+ 'actions',
+ ]}
+ queries={props.queries}
+ actions={props.actions}
+ displayLimit={props.displayLimit}
+ />
Review comment:
good call
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]