|
|
|
@ -43,7 +43,13 @@ import { RuleChainService } from '@core/http/rule-chain.service'; |
|
|
|
import { AliasInfo, StateParams, SubscriptionInfo } from '@core/api/widget-api.models'; |
|
|
|
import { DataKey, Datasource, DatasourceType, KeyInfo } from '@app/shared/models/widget.models'; |
|
|
|
import { UtilsService } from '@core/services/utils.service'; |
|
|
|
import { AliasFilterType, EntityAlias, EntityAliasFilter, EntityAliasFilterResult } from '@shared/models/alias.models'; |
|
|
|
import { |
|
|
|
AliasFilterType, |
|
|
|
edgeAliasFilterTypes, |
|
|
|
EntityAlias, |
|
|
|
EntityAliasFilter, |
|
|
|
EntityAliasFilterResult |
|
|
|
} from '@shared/models/alias.models'; |
|
|
|
import { |
|
|
|
EdgeImportEntityData, |
|
|
|
EntitiesKeysByQuery, |
|
|
|
@ -495,7 +501,11 @@ export class EntityService { |
|
|
|
} |
|
|
|
|
|
|
|
public getAliasFilterTypesByEntityTypes(entityTypes: Array<EntityType | AliasEntityType>): Array<AliasFilterType> { |
|
|
|
const allAliasFilterTypes: Array<AliasFilterType> = Object.keys(AliasFilterType).map((key) => AliasFilterType[key]); |
|
|
|
const authState = getCurrentAuthState(this.store); |
|
|
|
let allAliasFilterTypes: Array<AliasFilterType> = Object.values(AliasFilterType); |
|
|
|
if (!authState.edgesSupportEnabled) { |
|
|
|
allAliasFilterTypes = allAliasFilterTypes.filter(aliasFilterType => !edgeAliasFilterTypes.includes(aliasFilterType)); |
|
|
|
} |
|
|
|
if (!entityTypes || !entityTypes.length) { |
|
|
|
return allAliasFilterTypes; |
|
|
|
} |
|
|
|
@ -622,14 +632,14 @@ export class EntityService { |
|
|
|
case Authority.TENANT_ADMIN: |
|
|
|
entityTypes.push(EntityType.DEVICE); |
|
|
|
entityTypes.push(EntityType.ASSET); |
|
|
|
if (authState.edgesSupportEnabled) { |
|
|
|
entityTypes.push(EntityType.EDGE); |
|
|
|
} |
|
|
|
entityTypes.push(EntityType.ENTITY_VIEW); |
|
|
|
entityTypes.push(EntityType.TENANT); |
|
|
|
entityTypes.push(EntityType.CUSTOMER); |
|
|
|
entityTypes.push(EntityType.USER); |
|
|
|
entityTypes.push(EntityType.DASHBOARD); |
|
|
|
if (authState.edgesSupportEnabled) { |
|
|
|
entityTypes.push(EntityType.EDGE); |
|
|
|
} |
|
|
|
if (useAliasEntityTypes) { |
|
|
|
entityTypes.push(AliasEntityType.CURRENT_CUSTOMER); |
|
|
|
entityTypes.push(AliasEntityType.CURRENT_TENANT); |
|
|
|
@ -638,13 +648,13 @@ export class EntityService { |
|
|
|
case Authority.CUSTOMER_USER: |
|
|
|
entityTypes.push(EntityType.DEVICE); |
|
|
|
entityTypes.push(EntityType.ASSET); |
|
|
|
if (authState.edgesSupportEnabled) { |
|
|
|
entityTypes.push(EntityType.EDGE); |
|
|
|
} |
|
|
|
entityTypes.push(EntityType.ENTITY_VIEW); |
|
|
|
entityTypes.push(EntityType.CUSTOMER); |
|
|
|
entityTypes.push(EntityType.USER); |
|
|
|
entityTypes.push(EntityType.DASHBOARD); |
|
|
|
if (authState.edgesSupportEnabled) { |
|
|
|
entityTypes.push(EntityType.EDGE); |
|
|
|
} |
|
|
|
if (useAliasEntityTypes) { |
|
|
|
entityTypes.push(AliasEntityType.CURRENT_CUSTOMER); |
|
|
|
} |
|
|
|
|