Browse Source

Handle impersonation and restricted view

pull/3464/head
Thomas Kaul 1 year ago
parent
commit
49c3e610e3
  1. 8
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

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

@ -505,7 +505,11 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
} }
} }
if (this.positions[symbol].assetSubClass === 'ETF') { if (
this.positions[symbol].assetSubClass === 'ETF' &&
!this.hasImpersonationId &&
!this.user.settings.isRestrictedView
) {
this.totalValueInEtf += this.positions[symbol].value; this.totalValueInEtf += this.positions[symbol].value;
} }
@ -553,6 +557,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
this.markets[UNKNOWN_KEY].value = this.markets[UNKNOWN_KEY].value =
this.markets[UNKNOWN_KEY].value / marketsTotal; this.markets[UNKNOWN_KEY].value / marketsTotal;
if (!this.hasImpersonationId && !this.user.settings.isRestrictedView) {
this.topHoldings = Object.values(this.topHoldingsMap) this.topHoldings = Object.values(this.topHoldingsMap)
.map(({ name, value }) => { .map(({ name, value }) => {
return { return {
@ -566,6 +571,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
return b.valueInBaseCurrency - a.valueInBaseCurrency; return b.valueInBaseCurrency - a.valueInBaseCurrency;
}); });
} }
}
private openAccountDetailDialog(aAccountId: string) { private openAccountDetailDialog(aAccountId: string) {
const dialogRef = this.dialog.open(AccountDetailDialog, { const dialogRef = this.dialog.open(AccountDetailDialog, {

Loading…
Cancel
Save