diff --git a/ui/src/app/components/datasource-entity.directive.js b/ui/src/app/components/datasource-entity.directive.js index f9074c7066..3b1dd19844 100644 --- a/ui/src/app/components/datasource-entity.directive.js +++ b/ui/src/app/components/datasource-entity.directive.js @@ -192,9 +192,9 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc dataKey.color = color; ngModelCtrl.$setDirty(); }); - } + }; - scope.editDataKey = function (event, dataKey, index) { + scope.editDataKey = function (event, dataKey) { $mdDialog.show({ controller: 'DatakeyConfigDialogController', @@ -214,11 +214,12 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc var w = angular.element($window); w.triggerHandler('resize'); } - }).then(function (dataKey) { - if ((dataKey.type === types.dataKeyType.timeseries) || (dataKey.type === types.dataKeyType.attribute)) { - scope.dataKeys[index] = dataKey; - } else if (dataKey.type === types.dataKeyType.alarm) { - scope.alarmDataKeys[index] = dataKey; + }).then(function (newDataKey) { + let index = scope.dataKeys.indexOf(dataKey); + if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) { + scope.dataKeys[index] = newDataKey; + } else if (newDataKey.type === types.dataKeyType.alarm) { + scope.alarmDataKeys[index] = newDataKey; } ngModelCtrl.$setDirty(); }, function () { diff --git a/ui/src/app/components/datasource-entity.scss b/ui/src/app/components/datasource-entity.scss index 75a2eed632..086f6f691f 100644 --- a/ui/src/app/components/datasource-entity.scss +++ b/ui/src/app/components/datasource-entity.scss @@ -24,6 +24,7 @@ display: block; height: 48px; line-height: 1.5; + white-space: normal !important; .tb-no-entries { line-height: 48px; @@ -32,7 +33,6 @@ li { height: auto !important; - white-space: normal !important; } } diff --git a/ui/src/app/components/datasource-entity.tpl.html b/ui/src/app/components/datasource-entity.tpl.html index b0461a9edf..9a58ecdb66 100644 --- a/ui/src/app/components/datasource-entity.tpl.html +++ b/ui/src/app/components/datasource-entity.tpl.html @@ -76,7 +76,7 @@