SingleStat: fix wrong call to getDataLinkUIModel (#32721)

This commit is contained in:
Guillermo Julián 2021-04-07 08:53:21 +02:00 committed by GitHub
parent ad5b838130
commit fbabed203f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ import {
locationUtil,
getFieldDisplayName,
getColorForTheme,
InterpolateFunction,
} from '@grafana/data';
import { convertOldAngularValueMapping } from '@grafana/ui';
@ -621,7 +622,9 @@ class SingleStatCtrl extends MetricsPanelCtrl {
elem.toggleClass('pointer', panel.links.length > 0);
if (panel.links.length > 0) {
linkInfo = linkSrv.getDataLinkUIModel(panel.links[0], data.scopedVars, {});
const replace: InterpolateFunction = (value, vars) =>
templateSrv.replace(value, { ...vars, ...data.scopedVars });
linkInfo = linkSrv.getDataLinkUIModel(panel.links[0], replace, {});
} else {
linkInfo = null;
}