Skip to content

Commit 6d1dd95

Browse files
bmundttorkelo
authored andcommitted
adds check for making datasource template variables children of other template variables (grafana#5717)
1 parent 4d40326 commit 6d1dd95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public/app/features/templating/templateValuesSrv.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ function (angular, _, $, kbn) {
166166
if (otherVariable === updatedVariable) {
167167
return;
168168
}
169-
if (templateSrv.containsVariable(otherVariable.query, updatedVariable.name) ||
169+
if ((otherVariable.type === "datasource" &&
170+
templateSrv.containsVariable(otherVariable.regex, updatedVariable.name)) ||
171+
templateSrv.containsVariable(otherVariable.query, updatedVariable.name) ||
170172
templateSrv.containsVariable(otherVariable.datasource, updatedVariable.name)) {
171173
return self.updateOptions(otherVariable);
172174
}

0 commit comments

Comments
 (0)