Templating: Fixed recursive url update issue for textbox variable (#26981)

* Templating: Fixed recursive url update issue for textbox variable

* Updated link

* updated e2e
This commit is contained in:
Torkel Ödegaard
2020-08-13 14:38:27 +02:00
committed by GitHub
parent eeeea7fb8d
commit 5398ef1103
5 changed files with 263 additions and 27 deletions

View File

@@ -82,9 +82,13 @@ export class BridgeSrv {
});
}
// Check for template variable changes on a dashboard
if (state.location.path === this.lastPath) {
// if only query params changed, check if variables changed
if (state.location.path === this.lastPath && state.location.query !== this.lastQuery) {
// Find template variable changes
const changes = findTemplateVarChanges(state.location.query, this.lastQuery);
// Store current query params to avoid recursion
this.lastQuery = state.location.query;
if (changes) {
const dash = getDashboardSrv().getCurrent();
if (dash) {
@@ -93,8 +97,8 @@ export class BridgeSrv {
}
}
this.lastQuery = state.location.query;
this.lastPath = state.location.path;
this.lastQuery = state.location.query;
this.lastUrl = state.location.url;
});