Skip to content

Commit 9fd7676

Browse files
committed
Merge branch 'v3.1.x'
2 parents 6d28365 + 0de0f4d commit 9fd7676

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

public/app/features/dashboard/dashboardSrv.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ function (angular, $, _, moment) {
1616
data = {};
1717
}
1818

19-
if (!data.id && data.version) {
20-
data.schemaVersion = data.version;
21-
}
22-
2319
this.id = data.id || null;
2420
this.title = data.title || 'No Title';
2521
this.autoUpdate = data.autoUpdate;

public/app/features/templating/templateValuesSrv.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function (angular, _, $, kbn) {
1111

1212
module.service('templateValuesSrv', function($q, $rootScope, datasourceSrv, $location, templateSrv, timeSrv) {
1313
var self = this;
14+
this.variableLock = {};
1415

1516
function getNoneOption() { return { text: 'None', value: '', isNone: true }; }
1617

@@ -101,6 +102,8 @@ function (angular, _, $, kbn) {
101102
} else {
102103
lock.resolve();
103104
}
105+
}).finally(function() {
106+
delete self.variableLock[variable.name];
104107
});
105108
};
106109

@@ -135,7 +138,7 @@ function (angular, _, $, kbn) {
135138
templateSrv.setGrafanaVariable('$__auto_interval', interval);
136139
};
137140

138-
this.setVariableValue = function(variable, option, initPhase) {
141+
this.setVariableValue = function(variable, option) {
139142
variable.current = angular.copy(option);
140143

141144
if (_.isArray(variable.current.text)) {
@@ -145,13 +148,7 @@ function (angular, _, $, kbn) {
145148
self.selectOptionsForCurrentValue(variable);
146149
templateSrv.updateTemplateData();
147150

148-
// on first load, variable loading is ordered to ensure
149-
// that parents are updated before children.
150-
if (initPhase) {
151-
return $q.when();
152-
}
153-
154-
return self.updateOptionsInChildVariables(variable);
151+
return this.updateOptionsInChildVariables(variable);
155152
};
156153

157154
this.variableUpdated = function(variable) {
@@ -160,6 +157,11 @@ function (angular, _, $, kbn) {
160157
};
161158

162159
this.updateOptionsInChildVariables = function(updatedVariable) {
160+
// if there is a variable lock ignore cascading update because we are in a boot up scenario
161+
if (self.variableLock[updatedVariable.name]) {
162+
return $q.when();
163+
}
164+
163165
var promises = _.map(self.variables, function(otherVariable) {
164166
if (otherVariable === updatedVariable) {
165167
return;

0 commit comments

Comments
 (0)