Commit 6afef792f453cb494b37336797d7929002e210be

Authored by Vladyslav
Committed by Igor Kulikov
1 parent 36a14702

Fix data key to alarm widget (#1978)

... ... @@ -215,10 +215,11 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc
215 215 w.triggerHandler('resize');
216 216 }
217 217 }).then(function (newDataKey) {
218   - let index = scope.dataKeys.indexOf(dataKey);
219 218 if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) {
  219 + let index = scope.dataKeys.indexOf(dataKey);
220 220 scope.dataKeys[index] = newDataKey;
221 221 } else if (newDataKey.type === types.dataKeyType.alarm) {
  222 + let index = scope.alarmDataKeys.indexOf(dataKey);
222 223 scope.alarmDataKeys[index] = newDataKey;
223 224 }
224 225 ngModelCtrl.$setDirty();
... ...
... ... @@ -183,10 +183,11 @@ function DatasourceFunc($compile, $templateCache, $mdDialog, $window, $document,
183 183 w.triggerHandler('resize');
184 184 }
185 185 }).then(function (newDataKey) {
186   - let index = scope.funcDataKeys.indexOf(dataKey);
187   - if (newDataKey.type === types.dataKeyType.function) {
188   - scope.funcDataKeys[index] = newDataKey;
  186 + if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) {
  187 + let index = scope.dataKeys.indexOf(dataKey);
  188 + scope.dataKeys[index] = newDataKey;
189 189 } else if (newDataKey.type === types.dataKeyType.alarm) {
  190 + let index = scope.alarmDataKeys.indexOf(dataKey);
190 191 scope.alarmDataKeys[index] = newDataKey;
191 192 }
192 193 ngModelCtrl.$setDirty();
... ...