|
|
@ -454,30 +454,22 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
if (position.holdings.length > 0) {
|
|
|
|
if (position.holdings.length > 0) {
|
|
|
|
for (const holding of position.holdings) {
|
|
|
|
for (const holding of position.holdings) {
|
|
|
|
const { name, valueInBaseCurrency } = holding;
|
|
|
|
const { allocationInPercentage, name, valueInBaseCurrency } =
|
|
|
|
|
|
|
|
holding;
|
|
|
|
if (
|
|
|
|
|
|
|
|
!this.hasImpersonationId &&
|
|
|
|
if (this.topHoldingsMap[name]?.value) {
|
|
|
|
!this.user.settings.isRestrictedView
|
|
|
|
this.topHoldingsMap[name].value += isNumber(valueInBaseCurrency)
|
|
|
|
) {
|
|
|
|
? valueInBaseCurrency
|
|
|
|
if (this.topHoldingsMap[name]?.value) {
|
|
|
|
: allocationInPercentage *
|
|
|
|
this.topHoldingsMap[name].value +=
|
|
|
|
this.portfolioDetails.holdings[symbol].valueInPercentage;
|
|
|
|
valueInBaseCurrency *
|
|
|
|
} else {
|
|
|
|
(isNumber(position.valueInBaseCurrency)
|
|
|
|
this.topHoldingsMap[name] = {
|
|
|
|
? position.valueInBaseCurrency
|
|
|
|
name,
|
|
|
|
: position.valueInPercentage);
|
|
|
|
value: isNumber(valueInBaseCurrency)
|
|
|
|
} else {
|
|
|
|
? valueInBaseCurrency
|
|
|
|
this.topHoldingsMap[name] = {
|
|
|
|
: allocationInPercentage *
|
|
|
|
name,
|
|
|
|
this.portfolioDetails.holdings[symbol].valueInPercentage
|
|
|
|
value:
|
|
|
|
};
|
|
|
|
valueInBaseCurrency *
|
|
|
|
|
|
|
|
(isNumber(position.valueInBaseCurrency)
|
|
|
|
|
|
|
|
? this.portfolioDetails.holdings[symbol]
|
|
|
|
|
|
|
|
.valueInBaseCurrency
|
|
|
|
|
|
|
|
: this.portfolioDetails.holdings[symbol]
|
|
|
|
|
|
|
|
.valueInPercentage)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -562,6 +554,14 @@ export class AllocationsPageComponent implements OnDestroy, 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) {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
name,
|
|
|
|
|
|
|
|
allocationInPercentage: value,
|
|
|
|
|
|
|
|
valueInBaseCurrency: null
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
allocationInPercentage:
|
|
|
|
allocationInPercentage:
|
|
|
@ -570,7 +570,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.sort((a, b) => {
|
|
|
|
.sort((a, b) => {
|
|
|
|
return b.valueInBaseCurrency - a.valueInBaseCurrency;
|
|
|
|
return b.allocationInPercentage - a.allocationInPercentage;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (this.topHoldings.length > MAX_TOP_HOLDINGS) {
|
|
|
|
if (this.topHoldings.length > MAX_TOP_HOLDINGS) {
|
|
|
|