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

fix(sqllab): Removed the tooltip from CopyToClipboard button in sqllab #18749

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
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 @@ -550,6 +550,7 @@ export default class ResultSet extends React.PureComponent<
<i className="fa fa-clipboard" /> {t('Copy to Clipboard')}
</Button>
}
hasTooltip={false}
/>
</ResultSetButtons>
{this.props.search && (
Expand Down
46 changes: 29 additions & 17 deletions superset-frontend/src/components/CopyToClipboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const propTypes = {
tooltipText: PropTypes.string,
addDangerToast: PropTypes.func.isRequired,
addSuccessToast: PropTypes.func.isRequired,
hasTooltip: PropTypes.bool,
};

const defaultProps = {
Expand All @@ -41,6 +42,7 @@ const defaultProps = {
shouldShowText: true,
wrapped: true,
tooltipText: t('Copy to clipboard'),
hasTooltip: true,
};

class CopyToClipboard extends React.Component {
Expand Down Expand Up @@ -88,15 +90,21 @@ class CopyToClipboard extends React.Component {

renderNotWrapped() {
return (
<Tooltip
id="copy-to-clipboard-tooltip"
placement="top"
style={{ cursor: 'pointer' }}
title={this.props.tooltipText}
trigger={['hover']}
>
{this.getDecoratedCopyNode()}
</Tooltip>
<>
{this.props.hasTooltip ? (
<Tooltip
id="copy-to-clipboard-tooltip"
placement="top"
style={{ cursor: 'pointer' }}
title={this.props.tooltipText}
trigger={['hover']}
>
{this.getDecoratedCopyNode()}
</Tooltip>
) : (
this.getDecoratedCopyNode()
)}
</>
);
}

Expand All @@ -108,14 +116,18 @@ class CopyToClipboard extends React.Component {
{this.props.text}
</span>
)}
<Tooltip
id="copy-to-clipboard-tooltip"
placement="top"
title={this.props.tooltipText}
trigger={['hover']}
>
{this.getDecoratedCopyNode()}
</Tooltip>
{this.props.hasTooltip ? (
<Tooltip
id="copy-to-clipboard-tooltip"
placement="top"
title={this.props.tooltipText}
trigger={['hover']}
>
{this.getDecoratedCopyNode()}
</Tooltip>
) : (
this.getDecoratedCopyNode()
)}
</span>
);
}
Expand Down