Browse Source

refactor: simplify user detail dialog routing logic

- Remove pending user ID logic as requested by maintainer
- Remove timing control logic for simpler implementation
- Add changelog entry for the routing improvement

Addresses maintainer feedback on PR
pull/5839/head
HarjobandeepSingh 5 days ago
parent
commit
fa7e1c3e82
  1. 9
      CHANGELOG.md
  2. 2
      apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
  3. 16
      apps/client/src/app/components/admin-users/admin-users.component.ts
  4. 2
      apps/client/src/app/components/rule/rule.component.ts
  5. 1
      apps/client/src/app/components/rules/rules.component.html
  6. 1
      apps/client/src/app/components/rules/rules.component.ts
  7. 2
      apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
  8. 4
      package-lock.json
  9. 2
      package.json

9
CHANGELOG.md

@ -5,7 +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).
## 2.211.0-beta.0 - 2025-10-24
## Unreleased
### Fixed
- Ensured the locale is available in the settings dialog to customize the rule thresholds of the _X-ray_ page
## 2.211.0 - 2025-10-25
### Added
@ -25,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed the style in the footer row of the accounts table
- Fixed the rendering of names and symbols for custom assets in the import activities dialog
- Fixed an issue with the market price in base currency during the portfolio snapshot calculation
## 2.210.1 - 2025-10-22

2
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts

@ -336,7 +336,7 @@ export abstract class PortfolioCalculator {
).mul(
exchangeRatesByCurrency[`${item.currency}${this.currency}`]?.[
endDateString
]
] ?? 1
);
const {

16
apps/client/src/app/components/admin-users/admin-users.component.ts

@ -88,7 +88,6 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit {
public totalItems = 0;
public user: User;
private pendingUserId: string | null = null;
private unsubscribeSubject = new Subject<void>();
public constructor(
@ -138,14 +137,7 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit {
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((params) => {
if (params['userId']) {
const userId = params['userId'] as string;
// Wait for users to be loaded before opening dialog
if (this.dataSource.data.length > 0) {
this.openUserDetailDialog(userId);
} else {
// Store the userId to open dialog after users are loaded
this.pendingUserId = userId;
}
this.openUserDetailDialog(params['userId']);
}
});
@ -281,12 +273,6 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit {
this.isLoading = false;
this.changeDetectorRef.markForCheck();
// Open dialog if there's a pending user ID
if (this.pendingUserId) {
this.openUserDetailDialog(this.pendingUserId);
this.pendingUserId = null;
}
});
}

2
apps/client/src/app/components/rule/rule.component.ts

@ -51,6 +51,7 @@ export class GfRuleComponent implements OnInit {
@Input() categoryName: string;
@Input() hasPermissionToUpdateUserSettings: boolean;
@Input() isLoading: boolean;
@Input() locale: string;
@Input() rule: PortfolioReportRule;
@Input() settings: XRayRulesSettings['AccountClusterRiskCurrentInvestment'];
@ -82,6 +83,7 @@ export class GfRuleComponent implements OnInit {
data: {
rule,
categoryName: this.categoryName,
locale: this.locale,
settings: this.settings
} as RuleSettingsDialogParams,
width: this.deviceType === 'mobile' ? '100vw' : '50rem'

1
apps/client/src/app/components/rules/rules.component.html

@ -12,6 +12,7 @@
[hasPermissionToUpdateUserSettings]="
hasPermissionToUpdateUserSettings
"
[locale]="locale"
[rule]="rule"
[settings]="settings?.[rule.key]"
(ruleUpdated)="onRuleUpdated($event)"

1
apps/client/src/app/components/rules/rules.component.ts

@ -26,6 +26,7 @@ export class GfRulesComponent {
@Input() categoryName: string;
@Input() hasPermissionToUpdateUserSettings: boolean;
@Input() isLoading: boolean;
@Input() locale: string;
@Input() rules: PortfolioReportRule[];
@Input() settings: XRayRulesSettings;

2
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html

@ -76,6 +76,7 @@
!hasImpersonationId && hasPermissionToUpdateUserSettings
"
[isLoading]="isLoading"
[locale]="user?.settings?.locale"
[rules]="category.rules"
[settings]="user?.settings?.xRayRules"
(rulesUpdated)="onRulesUpdated($event)"
@ -90,6 +91,7 @@
!hasImpersonationId && hasPermissionToUpdateUserSettings
"
[isLoading]="isLoading"
[locale]="user?.settings?.locale"
[rules]="inactiveRules"
[settings]="user?.settings?.xRayRules"
(rulesUpdated)="onRulesUpdated($event)"

4
package-lock.json

@ -1,12 +1,12 @@
{
"name": "ghostfolio",
"version": "2.211.0-beta.0",
"version": "2.211.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ghostfolio",
"version": "2.211.0-beta.0",
"version": "2.211.0",
"hasInstallScript": true,
"license": "AGPL-3.0",
"dependencies": {

2
package.json

@ -1,6 +1,6 @@
{
"name": "ghostfolio",
"version": "2.211.0-beta.0",
"version": "2.211.0",
"homepage": "https://ghostfol.io",
"license": "AGPL-3.0",
"repository": "https://github.com/ghostfolio/ghostfolio",

Loading…
Cancel
Save