From 420724838af712670af27eb6dbdec6a0ff72a8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20G=C3=BCnther?= Date: Sat, 18 Oct 2025 18:02:05 +0200 Subject: [PATCH] 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. --- CHANGELOG.md | 6 ++++++ apps/api/src/app/import/import.service.ts | 12 +++++++++++- apps/api/src/app/order/order.service.ts | 4 ++-- .../src/app/services/import-activities.service.ts | 6 +----- .../activities-table/activities-table.component.html | 5 ++++- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48d622193..952cc9203 100644 --- a/CHANGELOG.md +++ b/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/), 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 ### Added diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 2725747aa..73aaf0572 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -541,6 +541,7 @@ export class ImportService { dataSource, symbol, currency: assetProfile.currency, + name, userId: dataSource === 'MANUAL' ? user.id : undefined }, where: { @@ -746,10 +747,19 @@ export class ImportService { if (['FEE', 'INTEREST', 'LIABILITY'].includes(type)) { // Skip asset profile validation for FEE, INTEREST, and LIABILITY // 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 })] = { currency, dataSource, - symbol + symbol, + name: assetProfileInImport?.name }; continue; diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index 11579bbf1..5f5757aae 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -129,7 +129,7 @@ export class OrderService { const assetSubClass = data.assetSubClass; const dataSource: DataSource = 'MANUAL'; - let name: string; + let name: string = data.SymbolProfile.connectOrCreate.create.name; let symbol: string; if ( @@ -142,7 +142,7 @@ export class OrderService { symbol = data.SymbolProfile.connectOrCreate.create.symbol; } else { // Create custom asset profile - name = data.SymbolProfile.connectOrCreate.create.symbol; + name = name ?? data.SymbolProfile.connectOrCreate.create.symbol; symbol = uuidv4(); } diff --git a/apps/client/src/app/services/import-activities.service.ts b/apps/client/src/app/services/import-activities.service.ts index 323f07a5b..0f2715e47 100644 --- a/apps/client/src/app/services/import-activities.service.ts +++ b/apps/client/src/app/services/import-activities.service.ts @@ -76,12 +76,8 @@ export class ImportActivitiesService { updateAccountBalance: false }); - if ( - dataSource === DataSource.MANUAL && - !['FEE', 'INTEREST', 'LIABILITY'].includes(type) - ) { + if (dataSource === DataSource.MANUAL) { // Create synthetic asset profile for MANUAL data source - // (except for FEE, INTEREST, and LIABILITY which don't require asset profiles) assetProfiles.push({ currency, symbol, diff --git a/libs/ui/src/lib/activities-table/activities-table.component.html b/libs/ui/src/lib/activities-table/activities-table.component.html index 8079a6258..843832e1a 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.html +++ b/libs/ui/src/lib/activities-table/activities-table.component.html @@ -143,7 +143,10 @@ } - @if (!isUUID(element.SymbolProfile?.symbol)) { + @if ( + element.SymbolProfile?.dataSource !== 'MANUAL' && + !isUUID(element.SymbolProfile?.symbol) + ) {
{{ element.SymbolProfile?.symbol | gfSymbol