Browse Source
Task/improve data source column in market data table of admin control (#7722)
* Improve data source column by showing resolved name
* Update changelog
pull/7724/head
Thomas Kaul
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
36 additions and
2 deletions
-
CHANGELOG.md
-
apps/api/src/app/endpoints/asset-profiles/asset-profiles.service.ts
-
apps/client/src/app/components/admin-market-data/admin-market-data.html
-
libs/common/src/lib/interfaces/asset-profile-item.interface.ts
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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<DataSource, DataProviderInfo>( |
|
|
|
[ |
|
|
|
...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 |
|
|
|
|
|
|
|
@ -106,8 +106,19 @@ |
|
|
|
<th *matHeaderCellDef class="px-1" mat-header-cell mat-sort-header> |
|
|
|
<ng-container i18n>Data Source</ng-container> |
|
|
|
</th> |
|
|
|
<td *matCellDef="let element" class="px-1" mat-cell> |
|
|
|
{{ element.dataSource }} |
|
|
|
<td |
|
|
|
*matCellDef="let element" |
|
|
|
class="line-height-normal px-1 text-nowrap" |
|
|
|
mat-cell |
|
|
|
> |
|
|
|
<div> |
|
|
|
{{ element.dataProviderInfo?.name ?? element.dataSource }} |
|
|
|
</div> |
|
|
|
@if (element.dataProviderInfo?.name) { |
|
|
|
<div> |
|
|
|
<small class="text-muted">{{ element.dataSource }}</small> |
|
|
|
</div> |
|
|
|
} |
|
|
|
</td> |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
|
|
|
|
@ -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; |
|
|
|
|