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> {
renderCounter: number;
width: number;
height: number;
onInterpolate: InterpolateFunction;
replaceVariables: InterpolateFunction;
}
export interface PanelData {
......
......@@ -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);
};
......@@ -158,7 +158,7 @@ export class PanelChrome extends PureComponent<Props, State> {
width={width - 2 * variables.panelhorizontalpadding}
height={height - PANEL_HEADER_HEIGHT - variables.panelverticalpadding}
renderCounter={renderCounter}
onInterpolate={this.onInterpolate}
replaceVariables={this.replaceVariables}
/>
</div>
);
......
......@@ -15,11 +15,11 @@ interface Props extends PanelProps<GaugeOptions> {}
export class GaugePanel extends PureComponent<Props> {
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) {
......
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