Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove unused CodeModal #11972

Merged
merged 4 commits into from
Dec 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,30 @@
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import { t } from '@superset-ui/core';

import ModalTrigger from '../../components/ModalTrigger';
import ModalTrigger from 'src/components/ModalTrigger';

const propTypes = {
triggerNode: PropTypes.node.isRequired,
code: PropTypes.string,
codeCallback: PropTypes.func,
type CodeModalProps = {
triggerNode: JSX.Element;
code?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned here: i think this can be required now: https://github.com/apache/incubator-superset/pull/11971/files#r540334777

codeCallback: () => string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem to match the type of the default codeCallback prop

};

const defaultProps = {
codeCallback: () => {},
code: '',
type CodeModalState = {
code?: string;
};

export default class CodeModal extends React.PureComponent {
constructor(props) {
export default class CodeModal extends React.PureComponent<
CodeModalProps,
CodeModalState
> {
static defaultProps = {
codeCallback: () => {},
code: '',
};

constructor(props: CodeModalProps) {
super(props);
this.state = { code: props.code };
this.beforeOpen = this.beforeOpen.bind(this);
Expand Down Expand Up @@ -64,5 +70,3 @@ export default class CodeModal extends React.PureComponent {
);
}
}
CodeModal.propTypes = propTypes;
CodeModal.defaultProps = defaultProps;