Browse Source

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
main
Eduardo Almeida 17 hours ago
committed by GitHub
parent
commit
7b885a11e2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 10
      apps/api/src/services/symbol-profile/symbol-profile.service.ts
  3. 7
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  4. 6
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html
  5. 1
      libs/common/src/lib/interfaces/enhanced-symbol-profile.interface.ts

2
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

10
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;

7
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;
}

6
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" />

1
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;
}

Loading…
Cancel
Save