add expression

This commit is contained in:
Vladyslav Prykhodko 2019-06-22 01:01:46 +03:00
parent 8294240a03
commit 6a93307d28
3 changed files with 12 additions and 2 deletions

View File

@ -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]);

View File

@ -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) {

View File

@ -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') {