diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c5123b8f..6d94b78a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Supported a note for asset profiles + +### Fixed + +- Fixed the filter by asset sub class for the asset profiles in the admin control + ## 1.215.0 - 2022-11-27 ### Changed @@ -538,7 +548,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Support a note for activities +- Supported a note for activities ### Todo diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index d7235e9e6..87b9b9cc6 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -116,6 +116,7 @@ export class AdminService { }, assetClass: true, assetSubClass: true, + comment: true, countries: true, dataSource: true, Order: { @@ -150,6 +151,7 @@ export class AdminService { activitiesCount: symbolProfile._count.Order, assetClass: symbolProfile.assetClass, assetSubClass: symbolProfile.assetSubClass, + comment: symbolProfile.comment, dataSource: symbolProfile.dataSource, date: symbolProfile.Order?.[0]?.date, symbol: symbolProfile.symbol @@ -190,11 +192,13 @@ export class AdminService { } public async patchAssetProfileData({ + comment, dataSource, symbol, symbolMapping }: Prisma.SymbolProfileUpdateInput & UniqueAsset) { await this.symbolProfileService.updateSymbolProfile({ + comment, dataSource, symbol, symbolMapping diff --git a/apps/api/src/app/admin/update-asset-profile.dto.ts b/apps/api/src/app/admin/update-asset-profile.dto.ts index f21785f5b..228aa6f2c 100644 --- a/apps/api/src/app/admin/update-asset-profile.dto.ts +++ b/apps/api/src/app/admin/update-asset-profile.dto.ts @@ -1,6 +1,10 @@ -import { IsObject, IsOptional } from 'class-validator'; +import { IsObject, IsOptional, IsString } from 'class-validator'; export class UpdateAssetProfileDto { + @IsString() + @IsOptional() + comment?: string; + @IsObject() @IsOptional() symbolMapping?: { diff --git a/apps/api/src/services/symbol-profile.service.ts b/apps/api/src/services/symbol-profile.service.ts index edf6528ba..6cbbd8a4e 100644 --- a/apps/api/src/services/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile.service.ts @@ -104,12 +104,13 @@ export class SymbolProfileService { } public updateSymbolProfile({ + comment, dataSource, symbol, symbolMapping }: Prisma.SymbolProfileUpdateInput & UniqueAsset) { return this.prismaService.symbolProfile.update({ - data: { symbolMapping }, + data: { comment, symbolMapping }, where: { dataSource_symbol: { dataSource, symbol } } }); } diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts index 7ce9dda44..856382e5b 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts @@ -16,6 +16,7 @@ import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DATE_FORMAT, getDateFormatString } from '@ghostfolio/common/helper'; import { Filter, UniqueAsset, User } from '@ghostfolio/common/interfaces'; import { AdminMarketDataItem } from '@ghostfolio/common/interfaces/admin-market-data.interface'; +import { translate } from '@ghostfolio/ui/i18n'; import { AssetSubClass, DataSource } from '@prisma/client'; import { format, parseISO } from 'date-fns'; import { DeviceDetectorService } from 'ngx-device-detector'; @@ -44,10 +45,10 @@ export class AdminMarketDataComponent implements OnDestroy, OnInit { AssetSubClass.PRECIOUS_METAL, AssetSubClass.PRIVATE_EQUITY, AssetSubClass.STOCK - ].map((id) => { + ].map((assetSubClass) => { return { - id, - label: id, + id: assetSubClass, + label: translate(assetSubClass), type: 'ASSET_SUB_CLASS' }; }); @@ -67,6 +68,7 @@ export class AdminMarketDataComponent implements OnDestroy, OnInit { 'marketDataItemCount', 'sectorsCount', 'countriesCount', + 'comment', 'actions' ]; public filters$ = new Subject(); 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 f835b8af2..cea4bd684 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 @@ -100,6 +100,22 @@ + + + + + + + + + + +