diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index ab5ef0500..f2415dff3 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -74,6 +74,7 @@ export class PortfolioController { @Get('details') @UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseInterceptors(RedactValuesInResponseInterceptor) + @UseInterceptors(TransformDataSourceInRequestInterceptor) @UseInterceptors(TransformDataSourceInResponseInterceptor) public async getDetails( @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId: string, @@ -293,6 +294,7 @@ export class PortfolioController { @Get('dividends') @UseGuards(AuthGuard('jwt'), HasPermissionGuard) + @UseInterceptors(TransformDataSourceInRequestInterceptor) public async getDividends( @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId: string, @Query('accounts') filterByAccounts?: string, @@ -364,6 +366,7 @@ export class PortfolioController { @Get('holdings') @UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseInterceptors(RedactValuesInResponseInterceptor) + @UseInterceptors(TransformDataSourceInRequestInterceptor) @UseInterceptors(TransformDataSourceInResponseInterceptor) public async getHoldings( @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId: string, @@ -398,6 +401,7 @@ export class PortfolioController { @Get('investments') @UseGuards(AuthGuard('jwt'), HasPermissionGuard) + @UseInterceptors(TransformDataSourceInRequestInterceptor) public async getInvestments( @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId: string, @Query('accounts') filterByAccounts?: string, @@ -467,6 +471,7 @@ export class PortfolioController { @Get('performance') @UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseInterceptors(PerformanceLoggingInterceptor) + @UseInterceptors(TransformDataSourceInRequestInterceptor) @UseInterceptors(TransformDataSourceInResponseInterceptor) @Version('2') public async getPerformanceV2( diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts index 95435aa6e..004fa5f3f 100644 --- a/apps/client/src/app/components/header/header.component.ts +++ b/apps/client/src/app/components/header/header.component.ts @@ -176,15 +176,15 @@ export class HeaderComponent implements OnChanges { for (const filter of filters) { if (filter.type === 'ACCOUNT') { - userSetting[`filters.accounts`] = filter.id ? [filter.id] : null; + userSetting['filters.accounts'] = filter.id ? [filter.id] : null; } else if (filter.type === 'ASSET_CLASS') { - userSetting[`filters.assetClasses`] = filter.id ? [filter.id] : null; + userSetting['filters.assetClasses'] = filter.id ? [filter.id] : null; } else if (filter.type === 'DATA_SOURCE') { - userSetting[`filters.dataSource`] = filter.id ? filter.id : null; + userSetting['filters.dataSource'] = filter.id ? filter.id : null; } else if (filter.type === 'SYMBOL') { - userSetting[`filters.symbol`] = filter.id ? filter.id : null; + userSetting['filters.symbol'] = filter.id ? filter.id : null; } else if (filter.type === 'TAG') { - userSetting[`filters.tags`] = filter.id ? [filter.id] : null; + userSetting['filters.tags'] = filter.id ? [filter.id] : null; } } diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index 7e76b7d50..2bbf5a7c2 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -3,12 +3,7 @@ import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; -import { - AssetProfileIdentifier, - Filter, - PortfolioPosition, - User -} from '@ghostfolio/common/interfaces'; +import { Filter, PortfolioPosition, User } from '@ghostfolio/common/interfaces'; import { DateRange } from '@ghostfolio/common/types'; import { translate } from '@ghostfolio/ui/i18n'; @@ -307,6 +302,19 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { }); } + public holdingComparisonFunction( + option: PortfolioPosition, + value: PortfolioPosition + ): boolean { + if (value === null) { + return false; + } + + return ( + getAssetProfileIdentifier(option) === getAssetProfileIdentifier(value) + ); + } + public async initialize() { this.isLoading = true; this.keyManager = new FocusKeyManager(this.assistantListItems).withWrap(); @@ -491,18 +499,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { ); } - public holdingComparisonFunction( - option: AssetProfileIdentifier, - value: AssetProfileIdentifier - ): boolean { - if (value === null) { - return false; - } - return ( - getAssetProfileIdentifier(option) === getAssetProfileIdentifier(value) - ); - } - private initializeFilterForm() { this.dataService .fetchPortfolioHoldings({ @@ -528,8 +524,10 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { const symbol = this.user?.settings?.['filters.symbol']; const selectedHolding = this.holdings.find((holding) => { return ( - getAssetProfileIdentifier(holding) === - getAssetProfileIdentifier({ dataSource, symbol }) + getAssetProfileIdentifier({ + dataSource: holding.dataSource, + symbol: holding.symbol + }) === getAssetProfileIdentifier({ dataSource, symbol }) ); }); diff --git a/libs/ui/src/lib/assistant/assistant.html b/libs/ui/src/lib/assistant/assistant.html index 66ffcdffc..18c2145a3 100644 --- a/libs/ui/src/lib/assistant/assistant.html +++ b/libs/ui/src/lib/assistant/assistant.html @@ -134,15 +134,17 @@ }} @for (holding of holdings; track holding.name) { - - {{ holding.name }} - - {{ holding.symbol | gfSymbol }} · - {{ holding.currency }} + + + {{ holding.name }} + + {{ holding.symbol | gfSymbol }} · + {{ holding.currency }} + }