Commit 57810ea5 by Torkel Ödegaard Committed by GitHub

Merge pull request #15775 from ryantxu/rename-interpolate

use replaceVariables rather than onInterpolate
parents cee5f030 251008f5
...@@ -12,7 +12,7 @@ export interface PanelProps<T = any> { ...@@ -12,7 +12,7 @@ export interface PanelProps<T = any> {
renderCounter: number; renderCounter: number;
width: number; width: number;
height: number; height: number;
onInterpolate: InterpolateFunction; replaceVariables: InterpolateFunction;
} }
export interface PanelData { export interface PanelData {
......
...@@ -85,7 +85,7 @@ export class PanelChrome extends PureComponent<Props, State> { ...@@ -85,7 +85,7 @@ export class PanelChrome extends PureComponent<Props, State> {
}); });
}; };
onInterpolate = (value: string, format?: string) => { replaceVariables = (value: string, format?: string) => {
return templateSrv.replace(value, this.props.panel.scopedVars, format); return templateSrv.replace(value, this.props.panel.scopedVars, format);
}; };
...@@ -158,7 +158,7 @@ export class PanelChrome extends PureComponent<Props, State> { ...@@ -158,7 +158,7 @@ export class PanelChrome extends PureComponent<Props, State> {
width={width - 2 * variables.panelhorizontalpadding} width={width - 2 * variables.panelhorizontalpadding}
height={height - PANEL_HEADER_HEIGHT - variables.panelverticalpadding} height={height - PANEL_HEADER_HEIGHT - variables.panelverticalpadding}
renderCounter={renderCounter} renderCounter={renderCounter}
onInterpolate={this.onInterpolate} replaceVariables={this.replaceVariables}
/> />
</div> </div>
); );
......
...@@ -15,11 +15,11 @@ interface Props extends PanelProps<GaugeOptions> {} ...@@ -15,11 +15,11 @@ interface Props extends PanelProps<GaugeOptions> {}
export class GaugePanel extends PureComponent<Props> { export class GaugePanel extends PureComponent<Props> {
render() { render() {
const { panelData, width, height, onInterpolate, options } = this.props; const { panelData, width, height, replaceVariables, options } = this.props;
const { valueOptions } = options; const { valueOptions } = options;
const prefix = onInterpolate(valueOptions.prefix); const prefix = replaceVariables(valueOptions.prefix);
const suffix = onInterpolate(valueOptions.suffix); const suffix = replaceVariables(valueOptions.suffix);
let value: TimeSeriesValue; let value: TimeSeriesValue;
if (panelData.timeSeries) { if (panelData.timeSeries) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment