Skip to content

Commit

Permalink
add tooltip to control
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Jan 10, 2021
1 parent 2aa59c1 commit 033a485
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions superset-frontend/src/explore/components/AdhocMetricOption.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
import { Tooltip } from 'src/common/components/Tooltip';
import AdhocMetric from '../AdhocMetric';
import columnType from '../propTypes/columnType';
import savedMetricType from '../propTypes/savedMetricType';
Expand Down Expand Up @@ -70,17 +71,22 @@ class AdhocMetricOption extends React.PureComponent {
savedMetric={savedMetric}
datasourceType={datasourceType}
>
<DraggableOptionControlLabel
savedMetric={savedMetric}
label={adhocMetric.label}
onRemove={this.onRemoveMetric}
onMoveLabel={onMoveLabel}
onDropLabel={onDropLabel}
index={index}
type={OPTION_TYPES.metric}
isAdhoc
isFunction
/>
<Tooltip
placement="top"
title={savedMetric.expression || adhocMetric.label}
>
<DraggableOptionControlLabel
savedMetric={savedMetric}
label={adhocMetric.label}
onRemove={this.onRemoveMetric}
onMoveLabel={onMoveLabel}
onDropLabel={onDropLabel}
index={index}
type={OPTION_TYPES.metric}
isAdhoc
isFunction
/>
</Tooltip>
</AdhocMetricPopoverTrigger>
);
}
Expand Down

0 comments on commit 033a485

Please sign in to comment.