From aa3a55d1f55f346ac38576ff461949613a6b0666 Mon Sep 17 00:00:00 2001 From: Karel De Smet Date: Thu, 12 Feb 2026 08:04:21 +0100 Subject: [PATCH 1/3] Improve asset profile dialog routing --- .../admin-market-data.component.ts | 54 ++++++++++--------- .../admin-market-data/admin-market-data.html | 15 +++--- .../holding-detail-dialog.component.ts | 8 +++ .../holding-detail-dialog.html | 9 ++-- .../src/app/pages/admin/admin-page.routes.ts | 10 ++++ 5 files changed, 58 insertions(+), 38 deletions(-) diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts index 8f956b782..4ceb70a6b 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts @@ -13,6 +13,7 @@ import { import { AdminMarketDataItem } from '@ghostfolio/common/interfaces/admin-market-data.interface'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { GfSymbolPipe } from '@ghostfolio/common/pipes'; +import { internalRoutes } from '@ghostfolio/common/routes/routes'; import { GfActivitiesFilterComponent } from '@ghostfolio/ui/activities-filter'; import { translate } from '@ghostfolio/ui/i18n'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; @@ -157,6 +158,8 @@ export class GfAdminMarketDataComponent public isUUID = isUUID; public placeholder = ''; public pageSize = DEFAULT_PAGE_SIZE; + public routerLinkAdminControlMarketData = + internalRoutes.adminControl.subRoutes.marketData.routerLink; public selection: SelectionModel>; public totalItems = 0; public user: User; @@ -203,22 +206,23 @@ export class GfAdminMarketDataComponent this.displayedColumns.push('comment'); this.displayedColumns.push('actions'); - this.route.queryParams - .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe((params) => { - if ( - params['assetProfileDialog'] && - params['dataSource'] && - params['symbol'] - ) { - this.openAssetProfileDialog({ - dataSource: params['dataSource'], - symbol: params['symbol'] - }); - } else if (params['createAssetProfileDialog']) { - this.openCreateAssetProfileDialog(); - } - }); + if (this.route.snapshot.routeConfig.path === 'market-data/create') { + this.openCreateAssetProfileDialog(); + } else { + this.route.paramMap + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe((paramMap) => { + const dataSource = paramMap.get('dataSource') as DataSource; + const symbol = paramMap.get('symbol'); + + if (dataSource && symbol) { + this.openAssetProfileDialog({ + dataSource, + symbol + }); + } + }); + } this.userService.stateChanged .pipe(takeUntil(this.unsubscribeSubject)) @@ -344,15 +348,15 @@ export class GfAdminMarketDataComponent dataSource, symbol }: AssetProfileIdentifier) { - this.router.navigate([], { - queryParams: { - dataSource, - symbol, - assetProfileDialog: true - } + this.router.navigate([dataSource, symbol], { + relativeTo: this.route }); } + public getRouterLinkToAdminControlMarketData(dataSource, symbol) { + return [...this.routerLinkAdminControlMarketData, dataSource, symbol]; + } + public ngOnDestroy() { this.unsubscribeSubject.next(); this.unsubscribeSubject.complete(); @@ -453,7 +457,9 @@ export class GfAdminMarketDataComponent if (newAssetProfileIdentifier) { this.onOpenAssetProfileDialog(newAssetProfileIdentifier); } else { - this.router.navigate(['.'], { relativeTo: this.route }); + this.router.navigate( + internalRoutes.adminControl.subRoutes.marketData.routerLink + ); } } ); @@ -484,7 +490,7 @@ export class GfAdminMarketDataComponent .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((result) => { if (!result) { - this.router.navigate(['.'], { relativeTo: this.route }); + this.router.navigate(['..'], { relativeTo: this.route }); return; } diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.html b/apps/client/src/app/components/admin-market-data/admin-market-data.html index 156ae0f5f..d64b541a8 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.html +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.html @@ -255,12 +255,12 @@ @@ -336,8 +336,7 @@ class="align-items-center d-flex justify-content-center" color="primary" mat-fab - [queryParams]="{ createAssetProfileDialog: true }" - [routerLink]="[]" + [routerLink]="['create']" > diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts index 427386796..f1987c021 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts @@ -618,6 +618,14 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { } } + public getRouterLinkToAdminControlMarketDataForDataSourceAndSymbol() { + return [ + ...this.routerLinkAdminControlMarketData, + this.SymbolProfile?.dataSource, + this.SymbolProfile?.symbol + ]; + } + public onUpdateActivity(aActivity: Activity) { this.router.navigate( internalRoutes.portfolio.subRoutes.activities.routerLink, diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index f9329dbfb..1f5e4e663 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -455,12 +455,9 @@ @if (data.hasPermissionToAccessAdminControl) { Manage Asset Profile Date: Thu, 12 Feb 2026 08:05:34 +0100 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39634dfc4..0894249b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Deprecated `transactionCount` in favor of `activitiesCount` in the endpoint `GET api/v1/admin` - Removed the deprecated `firstBuyDate` in the portfolio calculator +- Improved the routing of the asset profile dialog in the market data section of the admin control panel ## 2.234.0 - 2026-01-30 From 1593a69ec59be23be8fe6d204a5ad5ec4908a429 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 14 Feb 2026 12:20:12 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d31641824..1c7fe47cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Improved the routing of the asset profile dialog in the market data section of the admin control panel +- Improved the routing of the create asset profile dialog in the market data section of the admin control panel ## 2.238.0 - 2026-02-12