SingleStat: fix wrong call to getDataLinkUIModel (#32721) (#32739)

(cherry picked from commit fbabed203f)

Co-authored-by: Guillermo Julián <gjulianm@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2021-04-07 09:30:24 +02:00
committed by GitHub
co-authored by Guillermo Julián
parent d71e38eb96
commit b692d2fd4c
@@ -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;
}