Browse Source

Feature/improve Top 3 and Bottom 3 performers (#5289)

* Improve Top 3 and Bottom 3 performers

* Update changelog
pull/5291/head
Thomas Kaul 2 weeks ago
committed by GitHub
parent
commit
36d0ceeec5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 25
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
  3. 10
      apps/client/src/app/pages/portfolio/analysis/analysis-page.html

2
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the _Top 3_ and _Bottom 3_ performers on the analysis page by removing items without performance
- Improved the usability of the toggle component - Improved the usability of the toggle component
- Restructured the response of the portfolio report endpoint (_X-ray_) - Restructured the response of the portfolio report endpoint (_X-ray_)
- Refreshed the cryptocurrencies list - Refreshed the cryptocurrencies list
@ -25,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed the links of the _Top 3_ and _Bottom 3_ performers on the analysis page
- Excluded the holdings originated of `FEE`, `INTEREST` and `LIABILITY` activities from the closed holdings on the portfolio holdings page - Excluded the holdings originated of `FEE`, `INTEREST` and `LIABILITY` activities from the closed holdings on the portfolio holdings page
- Fixed an issue with serving _Storybook_ related to missing styles - Fixed an issue with serving _Storybook_ related to missing styles

25
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -32,6 +32,7 @@ import { MatCardModule } from '@angular/material/card';
import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'; import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSnackBar } from '@angular/material/snack-bar';
import { RouterModule } from '@angular/router';
import { IonIcon } from '@ionic/angular/standalone'; import { IonIcon } from '@ionic/angular/standalone';
import { SymbolProfile } from '@prisma/client'; import { SymbolProfile } from '@prisma/client';
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
@ -55,7 +56,8 @@ import { takeUntil } from 'rxjs/operators';
MatCardModule, MatCardModule,
MatMenuModule, MatMenuModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
NgxSkeletonLoaderModule NgxSkeletonLoaderModule,
RouterModule
], ],
selector: 'gf-analysis-page', selector: 'gf-analysis-page',
styleUrls: ['./analysis-page.scss'], styleUrls: ['./analysis-page.scss'],
@ -342,13 +344,20 @@ export class GfAnalysisPageComponent implements OnDestroy, OnInit {
'netPerformancePercentWithCurrencyEffect' 'netPerformancePercentWithCurrencyEffect'
).reverse(); ).reverse();
this.top3 = holdingsSorted.slice(0, 3); this.top3 = holdingsSorted
.filter(
if (holdings?.length > 3) { ({ netPerformancePercentWithCurrencyEffect }) =>
this.bottom3 = holdingsSorted.slice(-3).reverse(); netPerformancePercentWithCurrencyEffect > 0
} else { )
this.bottom3 = []; .slice(0, 3);
}
this.bottom3 = holdingsSorted
.filter(
({ netPerformancePercentWithCurrencyEffect }) =>
netPerformancePercentWithCurrencyEffect < 0
)
.slice(-3)
.reverse();
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
}); });

10
apps/client/src/app/pages/portfolio/analysis/analysis-page.html

@ -93,7 +93,7 @@
<div class="mb-5 row"> <div class="mb-5 row">
<div class="col"> <div class="col">
<mat-card appearance="outlined" class="mb-3"> <mat-card appearance="outlined">
<mat-card-content> <mat-card-content>
<div class="d-flex py-1"> <div class="d-flex py-1">
<div <div
@ -232,8 +232,8 @@
</div> </div>
<div class="mb-5 row"> <div class="mb-5 row">
<div class="col-md-6"> <div class="col-md-6 mb-3">
<mat-card appearance="outlined" class="mb-3"> <mat-card appearance="outlined" class="h-100">
<mat-card-header> <mat-card-header>
<mat-card-title class="align-items-center d-flex" i18n <mat-card-title class="align-items-center d-flex" i18n
>Top</mat-card-title >Top</mat-card-title
@ -281,8 +281,8 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</div> </div>
<div class="col-md-6"> <div class="col-md-6 mb-3">
<mat-card appearance="outlined" class="mb-3"> <mat-card appearance="outlined" class="h-100">
<mat-card-header> <mat-card-header>
<mat-card-title class="align-items-center d-flex" i18n <mat-card-title class="align-items-center d-flex" i18n
>Bottom</mat-card-title >Bottom</mat-card-title

Loading…
Cancel
Save