From 251008f590c1e89672a41aa521851074d79fdeda Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 4 Mar 2019 11:44:38 -0800 Subject: [PATCH] use replaceVariables rather than onInterpolate --- packages/grafana-ui/src/types/panel.ts | 2 +- public/app/features/dashboard/dashgrid/PanelChrome.tsx | 4 ++-- public/app/plugins/panel/gauge/GaugePanel.tsx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/grafana-ui/src/types/panel.ts b/packages/grafana-ui/src/types/panel.ts index 2da48b0fec6..6cc56c9287d 100644 --- a/packages/grafana-ui/src/types/panel.ts +++ b/packages/grafana-ui/src/types/panel.ts @@ -12,7 +12,7 @@ export interface PanelProps { renderCounter: number; width: number; height: number; - onInterpolate: InterpolateFunction; + replaceVariables: InterpolateFunction; } export interface PanelData { diff --git a/public/app/features/dashboard/dashgrid/PanelChrome.tsx b/public/app/features/dashboard/dashgrid/PanelChrome.tsx index 16f8f0820bb..80ce2f39b70 100644 --- a/public/app/features/dashboard/dashgrid/PanelChrome.tsx +++ b/public/app/features/dashboard/dashgrid/PanelChrome.tsx @@ -85,7 +85,7 @@ export class PanelChrome extends PureComponent { }); }; - onInterpolate = (value: string, format?: string) => { + replaceVariables = (value: string, format?: string) => { return templateSrv.replace(value, this.props.panel.scopedVars, format); }; @@ -158,7 +158,7 @@ export class PanelChrome extends PureComponent { width={width - 2 * variables.panelhorizontalpadding} height={height - PANEL_HEADER_HEIGHT - variables.panelverticalpadding} renderCounter={renderCounter} - onInterpolate={this.onInterpolate} + replaceVariables={this.replaceVariables} /> ); diff --git a/public/app/plugins/panel/gauge/GaugePanel.tsx b/public/app/plugins/panel/gauge/GaugePanel.tsx index e7e60a7c417..2a42e31b9ab 100644 --- a/public/app/plugins/panel/gauge/GaugePanel.tsx +++ b/public/app/plugins/panel/gauge/GaugePanel.tsx @@ -15,11 +15,11 @@ interface Props extends PanelProps {} export class GaugePanel extends PureComponent { render() { - const { panelData, width, height, onInterpolate, options } = this.props; + const { panelData, width, height, replaceVariables, options } = this.props; const { valueOptions } = options; - const prefix = onInterpolate(valueOptions.prefix); - const suffix = onInterpolate(valueOptions.suffix); + const prefix = replaceVariables(valueOptions.prefix); + const suffix = replaceVariables(valueOptions.suffix); let value: TimeSeriesValue; if (panelData.timeSeries) {