Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix asset profile deletion and allow editing asset profile identifiers with MANUAL data source (#6090)

Eduardo Almeida7b885a11e231
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cef903f162..789dd28af2 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 c41a59c789..4c2c425896 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 3fe944a259..57ee57f19e 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 5f684ab472..ce0cafbc15 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()"
>
<ion-icon name="create-outline" />
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 4cc6ba8aa5..8426916c97 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;
}