Browse Source

Fix custom asset name rendering in import activities dialog (#5784)

- Include name field for FEE/INTEREST/LIABILITY asset profiles in backend validation
  - Hide symbol subtitle for MANUAL dataSource assets in activities table
  - Create asset profiles for all MANUAL activities in CSV import (not just BUY)
  - Preserve provided name when creating orders to prevent names disappearing after import

  Fixes rendering issues where custom asset names were missing or incorrectly
  displayed as symbols in import preview and activities list.
pull/5787/head
Sven Günther 2 weeks ago
parent
commit
420724838a
  1. 6
      CHANGELOG.md
  2. 12
      apps/api/src/app/import/import.service.ts
  3. 4
      apps/api/src/app/order/order.service.ts
  4. 6
      apps/client/src/app/services/import-activities.service.ts
  5. 5
      libs/ui/src/lib/activities-table/activities-table.component.html

6
CHANGELOG.md

@ -5,6 +5,12 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fixed rendering of custom asset names / symbol in import activities dialog
## 2.209.0 - 2025-10-18 ## 2.209.0 - 2025-10-18
### Added ### Added

12
apps/api/src/app/import/import.service.ts

@ -541,6 +541,7 @@ export class ImportService {
dataSource, dataSource,
symbol, symbol,
currency: assetProfile.currency, currency: assetProfile.currency,
name,
userId: dataSource === 'MANUAL' ? user.id : undefined userId: dataSource === 'MANUAL' ? user.id : undefined
}, },
where: { where: {
@ -746,10 +747,19 @@ export class ImportService {
if (['FEE', 'INTEREST', 'LIABILITY'].includes(type)) { if (['FEE', 'INTEREST', 'LIABILITY'].includes(type)) {
// Skip asset profile validation for FEE, INTEREST, and LIABILITY // Skip asset profile validation for FEE, INTEREST, and LIABILITY
// as these activity types don't require asset profiles // as these activity types don't require asset profiles
const assetProfileInImport = assetProfilesWithMarketDataDto?.find(
(profile) => {
return (
profile.dataSource === dataSource && profile.symbol === symbol
);
}
);
assetProfiles[getAssetProfileIdentifier({ dataSource, symbol })] = { assetProfiles[getAssetProfileIdentifier({ dataSource, symbol })] = {
currency, currency,
dataSource, dataSource,
symbol symbol,
name: assetProfileInImport?.name
}; };
continue; continue;

4
apps/api/src/app/order/order.service.ts

@ -129,7 +129,7 @@ export class OrderService {
const assetSubClass = data.assetSubClass; const assetSubClass = data.assetSubClass;
const dataSource: DataSource = 'MANUAL'; const dataSource: DataSource = 'MANUAL';
let name: string; let name: string = data.SymbolProfile.connectOrCreate.create.name;
let symbol: string; let symbol: string;
if ( if (
@ -142,7 +142,7 @@ export class OrderService {
symbol = data.SymbolProfile.connectOrCreate.create.symbol; symbol = data.SymbolProfile.connectOrCreate.create.symbol;
} else { } else {
// Create custom asset profile // Create custom asset profile
name = data.SymbolProfile.connectOrCreate.create.symbol; name = name ?? data.SymbolProfile.connectOrCreate.create.symbol;
symbol = uuidv4(); symbol = uuidv4();
} }

6
apps/client/src/app/services/import-activities.service.ts

@ -76,12 +76,8 @@ export class ImportActivitiesService {
updateAccountBalance: false updateAccountBalance: false
}); });
if ( if (dataSource === DataSource.MANUAL) {
dataSource === DataSource.MANUAL &&
!['FEE', 'INTEREST', 'LIABILITY'].includes(type)
) {
// Create synthetic asset profile for MANUAL data source // Create synthetic asset profile for MANUAL data source
// (except for FEE, INTEREST, and LIABILITY which don't require asset profiles)
assetProfiles.push({ assetProfiles.push({
currency, currency,
symbol, symbol,

5
libs/ui/src/lib/activities-table/activities-table.component.html

@ -143,7 +143,10 @@
} }
</div> </div>
</div> </div>
@if (!isUUID(element.SymbolProfile?.symbol)) { @if (
element.SymbolProfile?.dataSource !== 'MANUAL' &&
!isUUID(element.SymbolProfile?.symbol)
) {
<div> <div>
<small class="text-muted">{{ <small class="text-muted">{{
element.SymbolProfile?.symbol | gfSymbol element.SymbolProfile?.symbol | gfSymbol

Loading…
Cancel
Save