Browse Source

Bugfix/sustainable retirement income for redacted values (#7976)

* Fix sustainable retirement income for redacted values

* Update changelog
pull/7977/head^2
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
11749d0c9a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
  3. 30
      apps/client/src/app/pages/portfolio/fire/fire-page.html

1
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

6
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

30
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</span
>
@ -84,7 +88,11 @@
[isCurrency]="true"
[locale]="user?.settings?.locale"
[unit]="user?.settings?.baseCurrency"
[value]="withdrawalRatePerMonth?.toNumber()"
[value]="
hasPermissionToShowValues
? withdrawalRatePerMonth?.toNumber()
: null
"
/>
per month</span
>, 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
"
/></span>
and a safe withdrawal rate (SWR) of</ng-container
>
@ -137,7 +149,11 @@
[isCurrency]="true"
[locale]="user?.settings?.locale"
[unit]="user?.settings?.baseCurrency"
[value]="withdrawalRatePerYearProjected?.toNumber()"
[value]="
hasPermissionToShowValues
? withdrawalRatePerYearProjected?.toNumber()
: null
"
/>
per year</span
>
@ -148,7 +164,11 @@
[isCurrency]="true"
[locale]="user?.settings?.locale"
[unit]="user?.settings?.baseCurrency"
[value]="withdrawalRatePerMonthProjected?.toNumber()"
[value]="
hasPermissionToShowValues
? withdrawalRatePerMonthProjected?.toNumber()
: null
"
/>
per month</span
>, assuming a

Loading…
Cancel
Save