Browse Source

Bugfix/fix broken allocation charts in presenter view (#6689)

* Fix broken allocation charts in presenter view

* Update changelog

---------

Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
pull/6692/head
David Requeno 1 week ago
committed by GitHub
parent
commit
dd31c18e2d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      CHANGELOG.md
  2. 19
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  3. 32
      apps/client/src/app/pages/portfolio/allocations/allocations-page.html

8
CHANGELOG.md

@ -17,6 +17,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Extended the terms of service for the _Ghostfolio_ SaaS (cloud) to include _Paid Plans_ and _Refund Policy_ - Extended the terms of service for the _Ghostfolio_ SaaS (cloud) to include _Paid Plans_ and _Refund Policy_
- Upgraded `prisma` from version `6.19.0` to `6.19.3` - Upgraded `prisma` from version `6.19.0` to `6.19.3`
### Fixed
- Fixed the allocations by account chart on the allocations page in the _Presenter View_
- Fixed the allocations by asset class chart on the allocations page in the _Presenter View_
- Fixed the allocations by currency chart on the allocations page in the _Presenter View_
- Fixed the allocations by ETF provider chart on the allocations page in the _Presenter View_
- Fixed the allocations by platform chart on the allocations page in the _Presenter View_
## 2.252.0 - 2026-03-02 ## 2.252.0 - 2026-03-02
### Added ### Added

19
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -159,10 +159,9 @@ export class GfAllocationsPageComponent implements OnInit {
if (state?.user) { if (state?.user) {
this.user = state.user; this.user = state.user;
this.worldMapChartFormat = this.worldMapChartFormat = this.showValuesInPercentage()
this.hasImpersonationId || this.user.settings.isRestrictedView ? `{0}%`
? `{0}%` : `{0} ${this.user?.settings?.baseCurrency}`;
: `{0} ${this.user?.settings?.baseCurrency}`;
this.isLoading = true; this.isLoading = true;
@ -310,7 +309,7 @@ export class GfAllocationsPageComponent implements OnInit {
] of Object.entries(this.portfolioDetails.accounts)) { ] of Object.entries(this.portfolioDetails.accounts)) {
let value = 0; let value = 0;
if (this.hasImpersonationId) { if (this.showValuesInPercentage()) {
value = valueInPercentage; value = valueInPercentage;
} else { } else {
value = valueInBaseCurrency; value = valueInBaseCurrency;
@ -328,7 +327,7 @@ export class GfAllocationsPageComponent implements OnInit {
)) { )) {
let value = 0; let value = 0;
if (this.hasImpersonationId) { if (this.showValuesInPercentage()) {
value = position.allocationInPercentage; value = position.allocationInPercentage;
} else { } else {
value = position.valueInBaseCurrency; value = position.valueInBaseCurrency;
@ -491,7 +490,7 @@ export class GfAllocationsPageComponent implements OnInit {
] of Object.entries(this.portfolioDetails.platforms)) { ] of Object.entries(this.portfolioDetails.platforms)) {
let value = 0; let value = 0;
if (this.hasImpersonationId) { if (this.showValuesInPercentage()) {
value = valueInPercentage; value = valueInPercentage;
} else { } else {
value = valueInBaseCurrency; value = valueInBaseCurrency;
@ -506,7 +505,7 @@ export class GfAllocationsPageComponent implements OnInit {
this.topHoldings = Object.values(this.topHoldingsMap) this.topHoldings = Object.values(this.topHoldingsMap)
.map(({ name, value }) => { .map(({ name, value }) => {
if (this.hasImpersonationId || this.user.settings.isRestrictedView) { if (this.showValuesInPercentage()) {
return { return {
name, name,
allocationInPercentage: value, allocationInPercentage: value,
@ -597,4 +596,8 @@ export class GfAllocationsPageComponent implements OnInit {
this.router.navigate(['.'], { relativeTo: this.route }); this.router.navigate(['.'], { relativeTo: this.route });
}); });
} }
public showValuesInPercentage() {
return this.hasImpersonationId || this.user?.settings?.isRestrictedView;
}
} }

32
apps/client/src/app/pages/portfolio/allocations/allocations-page.html

@ -25,11 +25,9 @@
<mat-card-content> <mat-card-content>
<mat-progress-bar <mat-progress-bar
mode="determinate" mode="determinate"
[title]=" [title]="`${(
`${( portfolioDetails?.summary?.filteredValueInPercentage * 100
portfolioDetails?.summary?.filteredValueInPercentage * 100 ).toFixed(2)}%`"
).toFixed(2)}%`
"
[value]="portfolioDetails?.summary?.filteredValueInPercentage * 100" [value]="portfolioDetails?.summary?.filteredValueInPercentage * 100"
/> />
</mat-card-content> </mat-card-content>
@ -49,7 +47,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="platforms" [data]="platforms"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['id']" [keys]="['id']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
@ -71,7 +69,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="holdings" [data]="holdings"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['currency']" [keys]="['currency']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
@ -93,7 +91,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="holdings" [data]="holdings"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['assetClassLabel', 'assetSubClassLabel']" [keys]="['assetClassLabel', 'assetSubClassLabel']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
@ -114,7 +112,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="symbols" [data]="symbols"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['symbol']" [keys]="['symbol']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[showLabels]="deviceType !== 'mobile'" [showLabels]="deviceType !== 'mobile'"
@ -138,7 +136,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="sectors" [data]="sectors"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['name']" [keys]="['name']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[maxItems]="10" [maxItems]="10"
@ -161,7 +159,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="continents" [data]="continents"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['name']" [keys]="['name']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
@ -183,7 +181,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="marketsAdvanced" [data]="marketsAdvanced"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
</mat-card-content> </mat-card-content>
@ -206,9 +204,7 @@
<gf-world-map-chart <gf-world-map-chart
[countries]="countries" [countries]="countries"
[format]="worldMapChartFormat" [format]="worldMapChartFormat"
[isInPercent]=" [isInPercent]="showValuesInPercentage()"
hasImpersonationId || user.settings.isRestrictedView
"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />
</div> </div>
@ -272,7 +268,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="countries" [data]="countries"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['name']" [keys]="['name']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[maxItems]="10" [maxItems]="10"
@ -291,7 +287,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="accounts" [data]="accounts"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['id']" [keys]="['id']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
(proportionChartClicked)="onAccountChartClicked($event)" (proportionChartClicked)="onAccountChartClicked($event)"
@ -314,7 +310,7 @@
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme" [colorScheme]="user?.settings?.colorScheme"
[data]="holdings" [data]="holdings"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView" [isInPercent]="showValuesInPercentage()"
[keys]="['etfProvider']" [keys]="['etfProvider']"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
/> />

Loading…
Cancel
Save