diff --git a/CHANGELOG.md b/CHANGELOG.md index c1bf23553..0992c5589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Harmonized the icons and labels in the access table to share the portfolio +- Improved the data source column in the historical market data table of the admin control panel by showing the name of the data provider - Migrated the create and edit access dialogs to dedicated routes - Improved the response of the historical market data gathering endpoint for a specific date - Introduced a timeout for the asset profile and the historical market data gathering jobs diff --git a/apps/api/src/app/endpoints/asset-profiles/asset-profiles.service.ts b/apps/api/src/app/endpoints/asset-profiles/asset-profiles.service.ts index c6ca5ebf4..e9aad6911 100644 --- a/apps/api/src/app/endpoints/asset-profiles/asset-profiles.service.ts +++ b/apps/api/src/app/endpoints/asset-profiles/asset-profiles.service.ts @@ -20,6 +20,7 @@ import { AssetProfileIdentifier, AssetProfileItem, AssetProfilesResponse, + DataProviderInfo, EnhancedAssetProfile, Filter } from '@ghostfolio/common/interfaces'; @@ -364,6 +365,23 @@ export class AssetProfilesService { ); } + const dataProviderInfoMap = new Map( + [ + ...new Set( + symbolProfiles.map(({ dataSource }) => { + return dataSource; + }) + ) + ].map((dataSource) => { + return [ + dataSource, + this.dataProviderService + .getDataProvider(dataSource) + .getDataProviderInfo() + ]; + }) + ); + let assetProfiles: AssetProfileItem[] = await Promise.all( symbolProfiles.map(async (assetProfile) => { const { @@ -417,6 +435,7 @@ export class AssetProfilesService { sectorsCount, symbol, activitiesCount: _count.activities, + dataProviderInfo: dataProviderInfoMap.get(dataSource), date: activities?.[0]?.date, isUsedByUsersWithSubscription: await isUsedByUsersWithSubscription, watchedByCount: _count.watchedBy diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.html b/apps/client/src/app/components/admin-market-data/admin-market-data.html index f6744b263..729ffede3 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.html +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.html @@ -106,8 +106,19 @@ Data Source - - {{ element.dataSource }} + +
+ {{ element.dataProviderInfo?.name ?? element.dataSource }} +
+ @if (element.dataProviderInfo?.name) { +
+ {{ element.dataSource }} +
+ } diff --git a/libs/common/src/lib/interfaces/asset-profile-item.interface.ts b/libs/common/src/lib/interfaces/asset-profile-item.interface.ts index 14e8471c1..382e824cc 100644 --- a/libs/common/src/lib/interfaces/asset-profile-item.interface.ts +++ b/libs/common/src/lib/interfaces/asset-profile-item.interface.ts @@ -1,5 +1,7 @@ import { AssetClass, AssetSubClass, DataSource } from '@prisma/client'; +import { DataProviderInfo } from './data-provider-info.interface'; + export interface AssetProfileItem { activitiesCount: number; assetClass?: AssetClass; @@ -7,6 +9,7 @@ export interface AssetProfileItem { comment?: string; countriesCount: number; currency: string; + dataProviderInfo?: DataProviderInfo; dataSource: DataSource; date: Date; id: string;