Browse Source

Merge branch 'main' into bugfix/fix-currency-inconsistency-with-GBX-and-GBp-in-eod-historical-data-service

pull/1869/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
c389d0e0e7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGELOG.md
  2. 23
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  3. 25
      apps/client/src/app/pages/portfolio/allocations/allocations-page.html

4
CHANGELOG.md

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- Introduced the allocations by ETF provider chart on the allocations page
### Fixed
- Fixed an issue with the currency inconsistency in the _EOD Historical Data_ service (convert from `GBX` to `GBp`)

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

@ -65,7 +65,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
| 'exchange'
| 'name'
| 'value'
>;
> & { etfProvider: string };
};
public sectors: {
[name: string]: { name: string; value: number };
@ -249,7 +249,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
public initializeAnalysisData() {
this.initialize();
for (const [id, { current, name, original }] of Object.entries(
for (const [id, { current, name }] of Object.entries(
this.portfolioDetails.accounts
)) {
this.accounts[id] = {
@ -275,6 +275,10 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
assetClass: position.assetClass,
assetSubClass: position.assetSubClass,
currency: position.currency,
etfProvider: this.extractEtfProvider({
assetSubClass: position.assetSubClass,
name: position.name
}),
exchange: position.exchange,
name: position.name
};
@ -452,4 +456,19 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
});
});
}
private extractEtfProvider({
assetSubClass,
name
}: {
assetSubClass: PortfolioPosition['assetSubClass'];
name: string;
}) {
if (assetSubClass === 'ETF') {
const [firstWord] = name.split(' ');
return firstWord;
}
return UNKNOWN_KEY;
}
}

25
apps/client/src/app/pages/portfolio/allocations/allocations-page.html

@ -249,4 +249,29 @@
</mat-card>
</div>
</div>
<div class="row">
<div class="col-md-4">
<mat-card appearance="outlined" class="mb-3">
<mat-card-header class="overflow-hidden w-100">
<mat-card-title class="align-items-center d-flex text-truncate"
><span i18n>By ETF Provider</span
><gf-premium-indicator
*ngIf="user?.subscription?.type === 'Basic'"
class="ml-1"
></gf-premium-indicator
></mat-card-title>
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
[baseCurrency]="user?.settings?.baseCurrency"
[colorScheme]="user?.settings?.colorScheme"
[isInPercent]="hasImpersonationId || user.settings.isRestrictedView"
[keys]="['etfProvider']"
[locale]="user?.settings?.locale"
[positions]="positions"
></gf-portfolio-proportion-chart>
</mat-card-content>
</mat-card>
</div>
</div>
</div>

Loading…
Cancel
Save