Fix not work in the autocomplete tooltip action create datakey (#2139)

This commit is contained in:
Vladyslav 2019-11-08 14:21:55 +02:00 committed by Igor Kulikov
parent fc78186414
commit 5d83d6c21c
2 changed files with 6 additions and 2 deletions

View File

@ -165,7 +165,11 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc
}; };
scope.transformAlarmDataKeyChip = function (chip) { 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) { scope.showColorPicker = function (event, dataKey) {

View File

@ -125,7 +125,7 @@
<div ng-if="textIsNotEmpty(alarmDataKeySearchText)"> <div ng-if="textIsNotEmpty(alarmDataKeySearchText)">
<span translate translate-values='{ key: "{{alarmDataKeySearchText | truncate:true:6:&apos;...&apos;}}" }'>entity.no-key-matching</span> <span translate translate-values='{ key: "{{alarmDataKeySearchText | truncate:true:6:&apos;...&apos;}}" }'>entity.no-key-matching</span>
<span> <span>
<a translate ng-click="createKey($event, '#alarm_datakey_chips')">entity.create-new-key</a> <a translate ng-click="createKey($event, types.dataKeyType.alarm, '#alarm_datakey_chips')">entity.create-new-key</a>
</span> </span>
</div> </div>
</div> </div>