|
@ -493,24 +493,30 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { |
|
|
parents: Object.entries(this.portfolioDetails.holdings) |
|
|
parents: Object.entries(this.portfolioDetails.holdings) |
|
|
.map(([symbol, holding]) => { |
|
|
.map(([symbol, holding]) => { |
|
|
if (holding.holdings.length > 0) { |
|
|
if (holding.holdings.length > 0) { |
|
|
const parentHolding = holding.holdings.find((parentHolding) => { |
|
|
const currentParentHolding = holding.holdings.find( |
|
|
|
|
|
(parentHolding) => { |
|
|
return parentHolding.name === name; |
|
|
return parentHolding.name === name; |
|
|
}); |
|
|
} |
|
|
return parentHolding |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return currentParentHolding |
|
|
? { |
|
|
? { |
|
|
allocationInPercentage: |
|
|
allocationInPercentage: |
|
|
parentHolding.valueInBaseCurrency / value, |
|
|
currentParentHolding.valueInBaseCurrency / value, |
|
|
name: holding.name, |
|
|
name: holding.name, |
|
|
position: holding, |
|
|
position: holding, |
|
|
symbol: prettifySymbol(symbol), |
|
|
symbol: prettifySymbol(symbol), |
|
|
valueInBaseCurrency: parentHolding.valueInBaseCurrency |
|
|
valueInBaseCurrency: |
|
|
|
|
|
currentParentHolding.valueInBaseCurrency |
|
|
} |
|
|
} |
|
|
: null; |
|
|
: null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return null; |
|
|
return null; |
|
|
}) |
|
|
}) |
|
|
.filter((item) => null !== item) |
|
|
.filter((item) => { |
|
|
|
|
|
return item !== null; |
|
|
|
|
|
}) |
|
|
.sort((a, b) => { |
|
|
.sort((a, b) => { |
|
|
return b.allocationInPercentage - a.allocationInPercentage; |
|
|
return b.allocationInPercentage - a.allocationInPercentage; |
|
|
}), |
|
|
}), |
|
|