From 11749d0c9adf829f011f831af8a2ed52ad61d17a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 30 Sep 2026 17:14:31 +0200 Subject: [PATCH] Bugfix/sustainable retirement income for redacted values (#7976) * Fix sustainable retirement income for redacted values * Update changelog --- CHANGELOG.md | 1 + .../portfolio/fire/fire-page.component.ts | 6 ++++ .../app/pages/portfolio/fire/fire-page.html | 30 +++++++++++++++---- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be16617266..a31f5f7b3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed the allocation column of the top holdings of ETFs on the allocations page after a change of the user settings - Fixed the value column of the top holdings of ETFs on the allocations page in the _Presenter View_ - Fixed the projected sustainable retirement income on the _FIRE_ page for a projected total amount of zero (experimental) +- Fixed the sustainable retirement income on the _FIRE_ page for redacted values - Fixed the emergency fund in the portfolio summary for redacted values - Fixed the redaction of `valueInBaseCurrency` in the holdings of ETFs in a restricted view diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts index 33b877d42f..a6a6c7dfd8 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts @@ -8,6 +8,7 @@ import { User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; +import { hasScope, scopes } from '@ghostfolio/common/scopes'; import { GfFireCalculatorComponent } from '@ghostfolio/ui/fire-calculator'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; import { DataService } from '@ghostfolio/ui/services'; @@ -53,6 +54,7 @@ export class GfFirePageComponent implements OnInit { protected fireWealth: FireWealth; protected hasImpersonationId: boolean; + protected hasPermissionToShowValues: boolean; protected hasPermissionToUpdateUserSettings: boolean; protected isLoading = false; protected retirementDate: Date; @@ -142,6 +144,10 @@ export class GfFirePageComponent implements OnInit { if (state?.user) { this.user = state.user; + this.hasPermissionToShowValues = + hasScope(this.user.scopes, scopes.portfolioReadValues) && + !this.user.settings.isRestrictedView; + this.hasPermissionToUpdateUserSettings = this.user.subscription?.type === SubscriptionType.Basic ? false diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.html b/apps/client/src/app/pages/portfolio/fire/fire-page.html index 7315f10cb0..3f12ddc126 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.html +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.html @@ -73,7 +73,11 @@ [isCurrency]="true" [locale]="user?.settings?.locale" [unit]="user?.settings?.baseCurrency" - [value]="withdrawalRatePerYear?.toNumber()" + [value]=" + hasPermissionToShowValues + ? withdrawalRatePerYear?.toNumber() + : null + " /> per year @@ -84,7 +88,11 @@ [isCurrency]="true" [locale]="user?.settings?.locale" [unit]="user?.settings?.baseCurrency" - [value]="withdrawalRatePerMonth?.toNumber()" + [value]=" + hasPermissionToShowValues + ? withdrawalRatePerMonth?.toNumber() + : null + " /> per month, based on your total assets of @@ -94,7 +102,11 @@ [isCurrency]="true" [locale]="user?.settings?.locale" [unit]="user?.settings?.baseCurrency" - [value]="fireWealth?.today.valueInBaseCurrency" + [value]=" + hasPermissionToShowValues + ? fireWealth?.today.valueInBaseCurrency + : null + " /> and a safe withdrawal rate (SWR) of @@ -137,7 +149,11 @@ [isCurrency]="true" [locale]="user?.settings?.locale" [unit]="user?.settings?.baseCurrency" - [value]="withdrawalRatePerYearProjected?.toNumber()" + [value]=" + hasPermissionToShowValues + ? withdrawalRatePerYearProjected?.toNumber() + : null + " /> per year @@ -148,7 +164,11 @@ [isCurrency]="true" [locale]="user?.settings?.locale" [unit]="user?.settings?.baseCurrency" - [value]="withdrawalRatePerMonthProjected?.toNumber()" + [value]=" + hasPermissionToShowValues + ? withdrawalRatePerMonthProjected?.toNumber() + : null + " /> per month, assuming a