Browse Source

Merge 1593a69ec5 into 0c970e2a14

pull/6309/merge
Karel De Smet 2 months ago
committed by GitHub
parent
commit
744d6c0bd6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      CHANGELOG.md
  2. 54
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
  3. 15
      apps/client/src/app/components/admin-market-data/admin-market-data.html
  4. 8
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts
  5. 9
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
  6. 10
      apps/client/src/app/pages/admin/admin-page.routes.ts

7
CHANGELOG.md

@ -5,6 +5,13 @@ 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
### 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
### Changed

54
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<Partial<SymbolProfile>>;
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;
}

15
apps/client/src/app/components/admin-market-data/admin-market-data.html

@ -255,12 +255,12 @@
<mat-menu #assetProfileActionsMenu="matMenu" xPosition="before">
<a
mat-menu-item
[queryParams]="{
assetProfileDialog: true,
dataSource: element.dataSource,
symbol: element.symbol
}"
[routerLink]="[]"
[routerLink]="
getRouterLinkToAdminControlMarketData(
element.dataSource,
element.symbol
)
"
>
<span class="align-items-center d-flex">
<ion-icon class="mr-2" name="create-outline" />
@ -336,8 +336,7 @@
class="align-items-center d-flex justify-content-center"
color="primary"
mat-fab
[queryParams]="{ createAssetProfileDialog: true }"
[routerLink]="[]"
[routerLink]="['create']"
>
<ion-icon name="add-outline" size="large" />
</a>

8
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,

9
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html

@ -454,12 +454,9 @@
@if (data.hasPermissionToAccessAdminControl) {
<a
mat-stroked-button
[queryParams]="{
assetProfileDialog: true,
dataSource: SymbolProfile?.dataSource,
symbol: SymbolProfile?.symbol
}"
[routerLink]="routerLinkAdminControlMarketData"
[routerLink]="
getRouterLinkToAdminControlMarketDataForDataSourceAndSymbol()
"
(click)="onClose()"
><ion-icon class="mr-1" name="create-outline" /><span i18n
>Manage Asset Profile</span

10
apps/client/src/app/pages/admin/admin-page.routes.ts

@ -29,6 +29,16 @@ export const routes: Routes = [
component: GfAdminMarketDataComponent,
title: internalRoutes.adminControl.subRoutes.marketData.title
},
{
path: `${internalRoutes.adminControl.subRoutes.marketData.path}/create`,
component: GfAdminMarketDataComponent,
title: internalRoutes.adminControl.subRoutes.marketData.title
},
{
path: `${internalRoutes.adminControl.subRoutes.marketData.path}/:dataSource/:symbol`,
component: GfAdminMarketDataComponent,
title: internalRoutes.adminControl.subRoutes.marketData.title
},
{
path: internalRoutes.adminControl.subRoutes.settings.path,
component: GfAdminSettingsComponent,

Loading…
Cancel
Save