You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/07 19:19:39 UTC
[GitHub] [superset] AAfghahi commented on a change in pull request #14978: refactor: Convert TableElement to TypeScript
AAfghahi commented on a change in pull request #14978:
URL: https://github.com/apache/superset/pull/14978#discussion_r646874738
##########
File path: superset-frontend/src/SqlLab/components/TableElement.tsx
##########
@@ -17,31 +17,58 @@
* under the License.
*/
import React, { useState } from 'react';
-import PropTypes from 'prop-types';
import Collapse from 'src/components/Collapse';
import Card from 'src/components/Card';
import ButtonGroup from 'src/components/ButtonGroup';
import { t, styled } from '@superset-ui/core';
import { debounce } from 'lodash';
import { Tooltip } from 'src/components/Tooltip';
-import Icons from 'src/components/Icons';
import CopyToClipboard from '../../components/CopyToClipboard';
import { IconTooltip } from '../../components/IconTooltip';
-import ColumnElement from './ColumnElement';
+import ColumnElement, { ColumnKeyTypeType } from './ColumnElement';
import ShowSQL from './ShowSQL';
import ModalTrigger from '../../components/ModalTrigger';
import Loading from '../../components/Loading';
-const propTypes = {
- table: PropTypes.object,
- actions: PropTypes.object,
-};
+// I don't think this makes sense to have
+// Shouldn't be rendering component if table and actions are'nt passed in
+// ----------------------
+// const defaultProps = {
+// actions: {},
+// table: null,
+// };
+// ----------------------
-const defaultProps = {
- actions: {},
- table: null,
-};
+interface Column {
+ name: string;
+ keys?: { type: ColumnKeyTypeType }[];
+ type: string;
+}
+
+interface Table {
+ name: string;
+ partitions?: {
+ partitionQuery: string;
+ latest: object[];
+ };
+ indexes: object[];
+ selectStar: string;
+ view: string;
+ isMetadataLoading: boolean;
+ isExtraMetadataLoading: boolean;
+ columns: Column[];
+}
+
+interface TableElementProps {
+ table: Table;
Review comment:
```suggestion
table: Table | null;
```
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org