From 5d83d6c21c5ddcd0dbf170417c835d4455ff3093 Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Fri, 8 Nov 2019 14:21:55 +0200 Subject: [PATCH] Fix not work in the autocomplete tooltip action create datakey (#2139) --- ui/src/app/components/datasource-entity.directive.js | 6 +++++- ui/src/app/components/datasource-entity.tpl.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/app/components/datasource-entity.directive.js b/ui/src/app/components/datasource-entity.directive.js index afde04e2d2..9ed05b8812 100644 --- a/ui/src/app/components/datasource-entity.directive.js +++ b/ui/src/app/components/datasource-entity.directive.js @@ -165,7 +165,11 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc }; scope.transformAlarmDataKeyChip = function (chip) { - return scope.generateDataKey({chip: chip, type: types.dataKeyType.alarm}); + if (chip.type) { + return scope.generateDataKey({chip: chip.name, type: chip.type}); + } else { + return scope.generateDataKey({chip: chip, type: types.dataKeyType.alarm}); + } }; scope.showColorPicker = function (event, dataKey) { diff --git a/ui/src/app/components/datasource-entity.tpl.html b/ui/src/app/components/datasource-entity.tpl.html index 9a58ecdb66..fe0d23eef7 100644 --- a/ui/src/app/components/datasource-entity.tpl.html +++ b/ui/src/app/components/datasource-entity.tpl.html @@ -125,7 +125,7 @@
entity.no-key-matching - entity.create-new-key + entity.create-new-key