|
|
@ -405,17 +405,22 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (position.holdings.length > 0) { |
|
|
if (position.holdings.length > 0) { |
|
|
for (const holding of position.holdings) { |
|
|
for (const { |
|
|
const { allocationInPercentage, name, valueInBaseCurrency } = |
|
|
allocationInPercentage, |
|
|
holding; |
|
|
name, |
|
|
|
|
|
valueInBaseCurrency |
|
|
if (this.topHoldingsMap[name]?.value) { |
|
|
} of position.holdings) { |
|
|
this.topHoldingsMap[name].value += isNumber(valueInBaseCurrency) |
|
|
const normalizedAssetName = this.normalizeAssetName(name); |
|
|
|
|
|
|
|
|
|
|
|
if (this.topHoldingsMap[normalizedAssetName]?.value) { |
|
|
|
|
|
this.topHoldingsMap[normalizedAssetName].value += isNumber( |
|
|
|
|
|
valueInBaseCurrency |
|
|
|
|
|
) |
|
|
? valueInBaseCurrency |
|
|
? valueInBaseCurrency |
|
|
: allocationInPercentage * |
|
|
: allocationInPercentage * |
|
|
this.portfolioDetails.holdings[symbol].valueInPercentage; |
|
|
this.portfolioDetails.holdings[symbol].valueInPercentage; |
|
|
} else { |
|
|
} else { |
|
|
this.topHoldingsMap[name] = { |
|
|
this.topHoldingsMap[normalizedAssetName] = { |
|
|
name, |
|
|
name, |
|
|
value: isNumber(valueInBaseCurrency) |
|
|
value: isNumber(valueInBaseCurrency) |
|
|
? valueInBaseCurrency |
|
|
? valueInBaseCurrency |
|
|
@ -518,7 +523,10 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
if (holding.holdings.length > 0) { |
|
|
if (holding.holdings.length > 0) { |
|
|
const currentParentHolding = holding.holdings.find( |
|
|
const currentParentHolding = holding.holdings.find( |
|
|
(parentHolding) => { |
|
|
(parentHolding) => { |
|
|
return parentHolding.name === name; |
|
|
return ( |
|
|
|
|
|
this.normalizeAssetName(parentHolding.name) === |
|
|
|
|
|
this.normalizeAssetName(name) |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
@ -555,6 +563,14 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private normalizeAssetName(name: string) { |
|
|
|
|
|
if (!name) { |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return name.trim().toLowerCase(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private openAccountDetailDialog(aAccountId: string) { |
|
|
private openAccountDetailDialog(aAccountId: string) { |
|
|
const dialogRef = this.dialog.open< |
|
|
const dialogRef = this.dialog.open< |
|
|
GfAccountDetailDialogComponent, |
|
|
GfAccountDetailDialogComponent, |
|
|
|