|
|
|
@ -906,28 +906,12 @@ export class EntityService { |
|
|
|
result.entityFilter = deepClone(filter); |
|
|
|
return of(result); |
|
|
|
case AliasFilterType.relationsQuery: |
|
|
|
result.stateEntity = filter.rootStateEntity; |
|
|
|
let rootEntityType; |
|
|
|
let rootEntityId; |
|
|
|
if (result.stateEntity && stateEntityId) { |
|
|
|
rootEntityType = stateEntityId.entityType; |
|
|
|
rootEntityId = stateEntityId.id; |
|
|
|
} else if (!result.stateEntity) { |
|
|
|
rootEntityType = filter.rootEntity.entityType; |
|
|
|
rootEntityId = filter.rootEntity.id; |
|
|
|
} |
|
|
|
if (rootEntityType && rootEntityId) { |
|
|
|
const relationQueryRootEntityId = this.resolveAliasEntityId(rootEntityType, rootEntityId); |
|
|
|
result.entityFilter = deepClone(filter); |
|
|
|
result.entityFilter.rootEntity = relationQueryRootEntityId; |
|
|
|
return of(result); |
|
|
|
} else { |
|
|
|
return of(result); |
|
|
|
} |
|
|
|
case AliasFilterType.assetSearchQuery: |
|
|
|
case AliasFilterType.deviceSearchQuery: |
|
|
|
case AliasFilterType.edgeSearchQuery: |
|
|
|
case AliasFilterType.entityViewSearchQuery: |
|
|
|
let rootEntityType; |
|
|
|
let rootEntityId; |
|
|
|
result.stateEntity = filter.rootStateEntity; |
|
|
|
if (result.stateEntity && stateEntityId) { |
|
|
|
rootEntityType = stateEntityId.entityType; |
|
|
|
@ -937,9 +921,9 @@ export class EntityService { |
|
|
|
rootEntityId = filter.rootEntity.id; |
|
|
|
} |
|
|
|
if (rootEntityType && rootEntityId) { |
|
|
|
const searchQueryRootEntityId = this.resolveAliasEntityId(rootEntityType, rootEntityId); |
|
|
|
const queryRootEntityId = this.resolveAliasEntityId(rootEntityType, rootEntityId); |
|
|
|
result.entityFilter = deepClone(filter); |
|
|
|
result.entityFilter.rootEntity = searchQueryRootEntityId; |
|
|
|
result.entityFilter.rootEntity = queryRootEntityId; |
|
|
|
return of(result); |
|
|
|
} else { |
|
|
|
return of(result); |
|
|
|
|