Browse Source

Handle impersonation and restricted view

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

32
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,18 +557,20 @@ 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;
this.topHoldings = Object.values(this.topHoldingsMap) if (!this.hasImpersonationId && !this.user.settings.isRestrictedView) {
.map(({ name, value }) => { this.topHoldings = Object.values(this.topHoldingsMap)
return { .map(({ name, value }) => {
name, return {
allocationInPercentage: name,
this.totalValueInEtf > 0 ? value / this.totalValueInEtf : 0, allocationInPercentage:
valueInBaseCurrency: value this.totalValueInEtf > 0 ? value / this.totalValueInEtf : 0,
}; valueInBaseCurrency: value
}) };
.sort((a, b) => { })
return b.valueInBaseCurrency - a.valueInBaseCurrency; .sort((a, b) => {
}); return b.valueInBaseCurrency - a.valueInBaseCurrency;
});
}
} }
private openAccountDetailDialog(aAccountId: string) { private openAccountDetailDialog(aAccountId: string) {

Loading…
Cancel
Save