mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(explore): long metric name display (#12387)
* fix(explore): long metric name display * add tooltip to control
This commit is contained in:
parent
9acf48fd1e
commit
c327cb911e
@ -58,6 +58,12 @@ const ResizeIcon = styled.i`
|
|||||||
margin-left: ${({ theme }) => theme.gridUnit * 2}px;
|
margin-left: ${({ theme }) => theme.gridUnit * 2}px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const ColumnOptionStyle = styled.span`
|
||||||
|
.option-label {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const SAVED_TAB_KEY = 'SAVED';
|
const SAVED_TAB_KEY = 'SAVED';
|
||||||
|
|
||||||
const startingWidth = 320;
|
const startingWidth = 320;
|
||||||
@ -220,7 +226,11 @@ export default class AdhocMetricEditPopover extends React.Component {
|
|||||||
if (column.metric_name && !column.verbose_name) {
|
if (column.metric_name && !column.verbose_name) {
|
||||||
column.verbose_name = column.metric_name;
|
column.verbose_name = column.metric_name;
|
||||||
}
|
}
|
||||||
return <ColumnOption column={column} showType />;
|
return (
|
||||||
|
<ColumnOptionStyle>
|
||||||
|
<ColumnOption column={column} showType />
|
||||||
|
</ColumnOptionStyle>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { Tooltip } from 'src/common/components/Tooltip';
|
||||||
import AdhocMetric from '../AdhocMetric';
|
import AdhocMetric from '../AdhocMetric';
|
||||||
import columnType from '../propTypes/columnType';
|
import columnType from '../propTypes/columnType';
|
||||||
import savedMetricType from '../propTypes/savedMetricType';
|
import savedMetricType from '../propTypes/savedMetricType';
|
||||||
@ -69,6 +70,10 @@ class AdhocMetricOption extends React.PureComponent {
|
|||||||
savedMetrics={savedMetrics}
|
savedMetrics={savedMetrics}
|
||||||
savedMetric={savedMetric}
|
savedMetric={savedMetric}
|
||||||
datasourceType={datasourceType}
|
datasourceType={datasourceType}
|
||||||
|
>
|
||||||
|
<Tooltip
|
||||||
|
placement="top"
|
||||||
|
title={savedMetric.expression || adhocMetric.label}
|
||||||
>
|
>
|
||||||
<DraggableOptionControlLabel
|
<DraggableOptionControlLabel
|
||||||
savedMetric={savedMetric}
|
savedMetric={savedMetric}
|
||||||
@ -81,6 +86,7 @@ class AdhocMetricOption extends React.PureComponent {
|
|||||||
isAdhoc
|
isAdhoc
|
||||||
isFunction
|
isFunction
|
||||||
/>
|
/>
|
||||||
|
</Tooltip>
|
||||||
</AdhocMetricPopoverTrigger>
|
</AdhocMetricPopoverTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,9 @@ const Label = styled.div`
|
|||||||
svg {
|
svg {
|
||||||
margin-right: ${({ theme }) => theme.gridUnit}px;
|
margin-right: ${({ theme }) => theme.gridUnit}px;
|
||||||
}
|
}
|
||||||
|
.option-label {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const CaretContainer = styled.div`
|
const CaretContainer = styled.div`
|
||||||
|
Loading…
Reference in New Issue
Block a user