- {col.type}
+ {column.type}
);
diff --git a/superset-frontend/src/SqlLab/components/ShowSQL.jsx b/superset-frontend/src/SqlLab/components/ShowSQL.tsx
similarity index 56%
rename from superset-frontend/src/SqlLab/components/ShowSQL.jsx
rename to superset-frontend/src/SqlLab/components/ShowSQL.tsx
index 9b030699a..002d16422 100644
--- a/superset-frontend/src/SqlLab/components/ShowSQL.jsx
+++ b/superset-frontend/src/SqlLab/components/ShowSQL.tsx
@@ -17,58 +17,48 @@
* under the License.
*/
import React from 'react';
-import PropTypes from 'prop-types';
import SyntaxHighlighter, {
registerLanguage,
+ // @ts-ignore
} from 'react-syntax-highlighter/dist/light';
+// @ts-ignore
import sql from 'react-syntax-highlighter/dist/languages/hljs/sql';
+// @ts-ignore
import github from 'react-syntax-highlighter/dist/styles/hljs/github';
-import { t } from '@superset-ui/translation';
-
import Link from '../../components/Link';
import ModalTrigger from '../../components/ModalTrigger';
registerLanguage('sql', sql);
-const propTypes = {
- tooltipText: PropTypes.string,
- title: PropTypes.string,
- sql: PropTypes.string,
-};
-
-const defaultProps = {
- tooltipText: t('Show SQL'),
- title: t('SQL statement'),
- sql: '',
-};
-
-export default class ShowSQL extends React.PureComponent {
- renderModalBody() {
- return (
-
-
- {this.props.sql}
-
-
- );
- }
- render() {
- return (
-
- }
- modalBody={this.renderModalBody()}
- />
- );
- }
+interface ShowSQLProps {
+ sql: string;
+ title: string;
+ tooltipText: string;
}
-ShowSQL.propTypes = propTypes;
-ShowSQL.defaultProps = defaultProps;
+export default function ShowSQL({
+ tooltipText,
+ title,
+ sql: sqlString,
+}: ShowSQLProps) {
+ return (
+
+ }
+ modalBody={
+
+
+ {sqlString}
+
+
+ }
+ />
+ );
+}
diff --git a/superset-frontend/src/SqlLab/constants.js b/superset-frontend/src/SqlLab/constants.ts
similarity index 100%
rename from superset-frontend/src/SqlLab/constants.js
rename to superset-frontend/src/SqlLab/constants.ts
diff --git a/superset-frontend/src/SqlLab/index.jsx b/superset-frontend/src/SqlLab/index.tsx
similarity index 100%
rename from superset-frontend/src/SqlLab/index.jsx
rename to superset-frontend/src/SqlLab/index.tsx
diff --git a/superset-frontend/webpack.config.js b/superset-frontend/webpack.config.js
index d436a3ac4..2d3545b81 100644
--- a/superset-frontend/webpack.config.js
+++ b/superset-frontend/webpack.config.js
@@ -180,7 +180,7 @@ const config = {
addSlice: addPreamble('/src/addSlice/index.tsx'),
explore: addPreamble('/src/explore/index.jsx'),
dashboard: addPreamble('/src/dashboard/index.jsx'),
- sqllab: addPreamble('/src/SqlLab/index.jsx'),
+ sqllab: addPreamble('/src/SqlLab/index.tsx'),
welcome: addPreamble('/src/welcome/index.jsx'),
profile: addPreamble('/src/profile/index.tsx'),
showSavedQuery: [path.join(APP_DIR, '/src/showSavedQuery/index.jsx')],