mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(templating): fixed scoped vars issue when generating urls for panel links, fixes #2410
This commit is contained in:
@@ -59,21 +59,21 @@ function (angular, kbn, _) {
|
||||
return info;
|
||||
};
|
||||
|
||||
this.getPanelLinkAnchorInfo = function(link) {
|
||||
this.getPanelLinkAnchorInfo = function(link, scopedVars) {
|
||||
var info = {};
|
||||
if (link.type === 'absolute') {
|
||||
info.target = link.targetBlank ? '_blank' : '_self';
|
||||
info.href = templateSrv.replace(link.url || '');
|
||||
info.title = templateSrv.replace(link.title || '');
|
||||
info.href = templateSrv.replace(link.url || '', scopedVars);
|
||||
info.title = templateSrv.replace(link.title || '', scopedVars);
|
||||
info.href += '?';
|
||||
}
|
||||
else if (link.dashUri) {
|
||||
info.href = 'dashboard/' + link.dashUri + '?';
|
||||
info.title = templateSrv.replace(link.title || '');
|
||||
info.title = templateSrv.replace(link.title || '', scopedVars);
|
||||
info.target = link.targetBlank ? '_blank' : '';
|
||||
}
|
||||
else {
|
||||
info.title = templateSrv.replace(link.title || '');
|
||||
info.title = templateSrv.replace(link.title || '', scopedVars);
|
||||
var slug = kbn.slugifyForUrl(link.dashboard || '');
|
||||
info.href = 'dashboard/db/' + slug + '?';
|
||||
}
|
||||
@@ -87,12 +87,12 @@ function (angular, kbn, _) {
|
||||
}
|
||||
|
||||
if (link.includeVars) {
|
||||
templateSrv.fillVariableValuesForUrl(params);
|
||||
templateSrv.fillVariableValuesForUrl(params, scopedVars);
|
||||
}
|
||||
|
||||
info.href = this.addParamsToUrl(info.href, params);
|
||||
if (link.params) {
|
||||
info.href += "&" + templateSrv.replace(link.params);
|
||||
info.href += "&" + templateSrv.replace(link.params, scopedVars);
|
||||
}
|
||||
|
||||
return info;
|
||||
|
||||
Reference in New Issue
Block a user