From 60acd6f56aa5b45f01c99768859d608c793f2ba0 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Wed, 8 Sep 2021 17:30:25 +0300 Subject: [PATCH] Code review changes --- ui-ngx/src/app/core/http/entity.service.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts index 704a3dcca9..78a7dc76df 100644 --- a/ui-ngx/src/app/core/http/entity.service.ts +++ b/ui-ngx/src/app/core/http/entity.service.ts @@ -502,15 +502,10 @@ export class EntityService { public getAliasFilterTypesByEntityTypes(entityTypes: Array): Array { const authState = getCurrentAuthState(this.store); - const allAliasFilterTypes: Array = Object.keys(AliasFilterType) - .map((key) => AliasFilterType[key]) - .filter(aft => { - if (authState.edgesSupportEnabled) { - return true; - } else { - return edgeAliasFilterTypes.indexOf(aft) === -1; - } - }); + let allAliasFilterTypes: Array = Object.values(AliasFilterType); + if (!authState.edgesSupportEnabled) { + allAliasFilterTypes = allAliasFilterTypes.filter(aliasFilterType => !edgeAliasFilterTypes.includes(aliasFilterType)); + } if (!entityTypes || !entityTypes.length) { return allAliasFilterTypes; }