From 7b885a11e23149ad942b8b147e0a09785d16297d Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Wed, 24 Dec 2025 10:18:13 +0000 Subject: [PATCH] Bugfix/fix asset profile deletion and allow editing asset profile identifiers with MANUAL data source (#6090) * Fix asset profile deletion and allow editing asset profile identifiers with MANUAL data source * Update changelog --- CHANGELOG.md | 2 ++ .../services/symbol-profile/symbol-profile.service.ts | 10 ++++++---- .../asset-profile-dialog.component.ts | 7 ------- .../asset-profile-dialog/asset-profile-dialog.html | 6 ++---- .../interfaces/enhanced-symbol-profile.interface.ts | 1 + 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cef903f16..789dd28af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Lifted the asset profile identifier editing restriction for `MANUAL` data sources in the asset profile details dialog of the admin control panel - Upgraded `shx` from version `0.3.4` to `0.4.0` ### Fixed - Added the missing currency suffix to the cash balance field in the create or update account dialog +- Fixed the delete button in the asset profile details dialog of the admin control panel by providing the missing `watchedByCount` parameter ## 2.224.2 - 2025-12-20 diff --git a/apps/api/src/services/symbol-profile/symbol-profile.service.ts b/apps/api/src/services/symbol-profile/symbol-profile.service.ts index c41a59c78..4c2c42589 100644 --- a/apps/api/src/services/symbol-profile/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile/symbol-profile.service.ts @@ -77,7 +77,7 @@ export class SymbolProfileService { .findMany({ include: { _count: { - select: { activities: true } + select: { activities: true, watchedBy: true } }, activities: { orderBy: { @@ -109,7 +109,7 @@ export class SymbolProfileService { .findMany({ include: { _count: { - select: { activities: true } + select: { activities: true, watchedBy: true } }, SymbolProfileOverrides: true }, @@ -184,7 +184,7 @@ export class SymbolProfileService { private enhanceSymbolProfiles( symbolProfiles: (SymbolProfile & { - _count: { activities: number }; + _count: { activities: number; watchedBy?: number }; activities?: { date: Date; }[]; @@ -206,10 +206,12 @@ export class SymbolProfileService { sectors: this.getSectors( symbolProfile?.sectors as unknown as Prisma.JsonArray ), - symbolMapping: this.getSymbolMapping(symbolProfile) + symbolMapping: this.getSymbolMapping(symbolProfile), + watchedByCount: 0 }; item.activitiesCount = symbolProfile._count.activities; + item.watchedByCount = symbolProfile._count.watchedBy ?? 0; delete item._count; item.dateOfFirstActivity = symbolProfile.activities?.[0]?.date; diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index 3fe944a25..57ee57f19 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -260,13 +260,6 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit { addIcons({ createOutline, ellipsisVertical, readerOutline, serverOutline }); } - public get canEditAssetProfileIdentifier() { - return ( - this.assetProfile?.assetClass && - !['MANUAL'].includes(this.assetProfile?.dataSource) - ); - } - public get canSaveAssetProfileIdentifier() { return !this.assetProfileForm.dirty; } diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html index 5f684ab47..ce0cafbc1 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html @@ -73,7 +73,8 @@ !adminMarketDataService.hasPermissionToDeleteAssetProfile({ activitiesCount: assetProfile?.activitiesCount, isBenchmark: isBenchmark, - symbol: data.symbol + symbol: data.symbol, + watchedByCount: assetProfile?.watchedByCount }) " (click)=" @@ -186,9 +187,6 @@ mat-button type="button" [disabled]="!canSaveAssetProfileIdentifier" - [ngClass]="{ - 'd-none': !canEditAssetProfileIdentifier - }" (click)="onSetEditAssetProfileIdentifierMode()" > diff --git a/libs/common/src/lib/interfaces/enhanced-symbol-profile.interface.ts b/libs/common/src/lib/interfaces/enhanced-symbol-profile.interface.ts index 4cc6ba8aa..8426916c9 100644 --- a/libs/common/src/lib/interfaces/enhanced-symbol-profile.interface.ts +++ b/libs/common/src/lib/interfaces/enhanced-symbol-profile.interface.ts @@ -33,4 +33,5 @@ export interface EnhancedSymbolProfile { updatedAt: Date; url?: string; userId?: string; + watchedByCount?: number; }