From 6a93307d289aa1178e3d77d9f3daac1a8e2683b9 Mon Sep 17 00:00:00 2001 From: Vladyslav Prykhodko Date: Sat, 22 Jun 2019 01:01:46 +0300 Subject: [PATCH] add expression --- ui/src/app/api/alias-controller.js | 4 +++- ui/src/app/api/entity.service.js | 8 +++++++- ui/src/app/common/utils.service.js | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/src/app/api/alias-controller.js b/ui/src/app/api/alias-controller.js index 824ccfa3eb..b038e04448 100644 --- a/ui/src/app/api/alias-controller.js +++ b/ui/src/app/api/alias-controller.js @@ -151,7 +151,8 @@ export default class AliasController { newDatasource.entityId = resolvedEntity.id; newDatasource.entityType = resolvedEntity.entityType; newDatasource.entityName = resolvedEntity.name; - newDatasource.entityDescription = resolvedEntity.entityDescription + newDatasource.entityLabel = resolvedEntity.label; + newDatasource.entityDescription = resolvedEntity.entityDescription; newDatasource.name = resolvedEntity.name; newDatasource.generated = i > 0 ? true : false; datasources.push(newDatasource); @@ -177,6 +178,7 @@ export default class AliasController { datasource.entityId = entity.id; datasource.entityType = entity.entityType; datasource.entityName = entity.name; + datasource.entityLabel = entity.label; datasource.name = entity.name; datasource.entityDescription = entity.entityDescription; deferred.resolve([datasource]); diff --git a/ui/src/app/api/entity.service.js b/ui/src/app/api/entity.service.js index 42b57596e5..94320e3819 100644 --- a/ui/src/app/api/entity.service.js +++ b/ui/src/app/api/entity.service.js @@ -344,7 +344,13 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device } function entityToEntityInfo(entity) { - return { origEntity: entity, name: entity.name, entityType: entity.id.entityType, id: entity.id.id, entityDescription: entity.additionalInfo?entity.additionalInfo.description:"" }; + return { + origEntity: entity, + name: entity.name, + entityType: entity.id.entityType, + id: entity.id.id, + entityDescription: entity.additionalInfo?entity.additionalInfo.description:"" + }; } function entityRelationInfoToEntityInfo(entityRelationInfo, direction) { diff --git a/ui/src/app/common/utils.service.js b/ui/src/app/common/utils.service.js index f140893d2b..ee3b94973b 100644 --- a/ui/src/app/common/utils.service.js +++ b/ui/src/app/common/utils.service.js @@ -497,6 +497,8 @@ function Utils($mdColorPalette, $rootScope, $window, $translate, $q, $timeout, t label = label.split(variable).join(datasource.entityName); } else if (variableName === 'deviceName') { label = label.split(variable).join(datasource.entityName); + } else if (variableName === 'entityLabel') { + label = label.split(variable).join(datasource.entityLabel); } else if (variableName === 'aliasName') { label = label.split(variable).join(datasource.aliasName); } else if (variableName === 'entityDescription') {