You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/01/29 15:02:30 UTC

[superset] branch master updated: fix: Remove double tooltip from metric label (#12736)

This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c6093a7  fix: Remove double tooltip from metric label (#12736)
c6093a7 is described below

commit c6093a74690178573bc8ad71cf92ccd1ed5fe5d2
Author: Kamil Gabryjelski <ka...@gmail.com>
AuthorDate: Fri Jan 29 16:01:58 2021 +0100

    fix: Remove double tooltip from metric label (#12736)
    
    * Remove tooltip from AdhocMetricOption
    
    * Lint fix
    
    * Add tooltip for adhoc metrics
    
    * Typo fix
---
 .../src/explore/components/OptionControls.tsx      |  3 ++-
 .../controls/MetricControl/AdhocMetricOption.jsx   | 28 +++++++++-------------
 2 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/superset-frontend/src/explore/components/OptionControls.tsx b/superset-frontend/src/explore/components/OptionControls.tsx
index 1cd683e..0a1d563 100644
--- a/superset-frontend/src/explore/components/OptionControls.tsx
+++ b/superset-frontend/src/explore/components/OptionControls.tsx
@@ -20,6 +20,7 @@ import React, { useRef } from 'react';
 import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd';
 import { styled, useTheme } from '@superset-ui/core';
 import { ColumnOption } from '@superset-ui/chart-controls';
+import { Tooltip } from 'src/common/components/Tooltip';
 import Icon from 'src/components/Icon';
 import { savedMetricType } from 'src/explore/components/controls/MetricControl/types';
 
@@ -215,7 +216,7 @@ export const OptionControlLabel = ({
       }
       return <ColumnOption column={column} />;
     }
-    return label;
+    return <Tooltip title={label}>{label}</Tooltip>;
   };
 
   const getOptionControlContent = () => (
diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.jsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.jsx
index 5ae886d..7aa8a05 100644
--- a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.jsx
+++ b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.jsx
@@ -18,7 +18,6 @@
  */
 import React from 'react';
 import PropTypes from 'prop-types';
-import { Tooltip } from 'src/common/components/Tooltip';
 import columnType from 'src/explore/propTypes/columnType';
 import { OptionControlLabel } from 'src/explore/components/OptionControls';
 import { OPTION_TYPES } from 'src/explore/components/optionTypes';
@@ -71,22 +70,17 @@ class AdhocMetricOption extends React.PureComponent {
         savedMetric={savedMetric}
         datasourceType={datasourceType}
       >
-        <Tooltip
-          placement="top"
-          title={savedMetric.expression || adhocMetric.label}
-        >
-          <OptionControlLabel
-            savedMetric={savedMetric}
-            label={adhocMetric.label}
-            onRemove={this.onRemoveMetric}
-            onMoveLabel={onMoveLabel}
-            onDropLabel={onDropLabel}
-            index={index}
-            type={OPTION_TYPES.metric}
-            isAdhoc
-            isFunction
-          />
-        </Tooltip>
+        <OptionControlLabel
+          savedMetric={savedMetric}
+          label={adhocMetric.label}
+          onRemove={this.onRemoveMetric}
+          onMoveLabel={onMoveLabel}
+          onDropLabel={onDropLabel}
+          index={index}
+          type={OPTION_TYPES.metric}
+          isAdhoc
+          isFunction
+        />
       </AdhocMetricPopoverTrigger>
     );
   }