From fdd80b1b4c36c5fbdb849612a9466c5cad3030a4 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 31 May 2021 03:31:18 -0400 Subject: [PATCH] StatPanel: Fixes data link tooltip not showing for single value (#34934) (#34962) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit d9e9e4744d2938bf232a1f1297142c4c34d959f7) Co-authored-by: Torkel Ödegaard --- packages/grafana-ui/src/components/BigValue/BigValue.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/BigValue/BigValue.tsx b/packages/grafana-ui/src/components/BigValue/BigValue.tsx index 24ed53c9c57..19be62baff7 100644 --- a/packages/grafana-ui/src/components/BigValue/BigValue.tsx +++ b/packages/grafana-ui/src/components/BigValue/BigValue.tsx @@ -59,6 +59,8 @@ export interface Props extends Themeable2 { text?: TextDisplayOptions; /** Specify which text should be visible in the BigValue */ textMode?: BigValueTextMode; + /** If true disables the tooltip */ + hasLinks?: boolean; /** * If part of a series of stat panes, this is the total number. @@ -73,7 +75,7 @@ export class BigValue extends PureComponent { }; render() { - const { onClick, className } = this.props; + const { onClick, className, hasLinks } = this.props; const layout = buildLayout(this.props); const panelStyles = layout.getPanelStyles(); const valueAndTitleContainerStyles = layout.getValueAndTitleContainerStyles(); @@ -81,8 +83,11 @@ export class BigValue extends PureComponent { const titleStyles = layout.getTitleStyles(); const textValues = layout.textValues; + // When there is an outer data link this tooltip will override the outer native tooltip + const tooltip = hasLinks ? undefined : textValues.tooltip; + return ( -
+
{textValues.title &&
{textValues.title}
}