From 032b9f7a63d161dcabeb2c385c405d077ab4c401 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 19 Feb 2025 10:59:55 +0100 Subject: [PATCH] Remove timeweighted performance from frontend --- .../benchmark-comparator.component.ts | 16 +---------- .../analysis/analysis-page.component.ts | 17 +---------- .../portfolio/analysis/analysis-page.html | 28 +------------------ 3 files changed, 3 insertions(+), 58 deletions(-) diff --git a/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts b/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts index 69b61b981..afcb561f6 100644 --- a/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts +++ b/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts @@ -55,7 +55,6 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy { @Input() isLoading: boolean; @Input() locale = getLocale(); @Input() performanceDataItems: LineChartItem[]; - @Input() timeWeightedPerformanceDataItems: LineChartItem[]; @Input() user: User; @Output() benchmarkChanged = new EventEmitter(); @@ -86,10 +85,7 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy { permissions.accessAdminControl ); - if ( - this.performanceDataItems || - this.timeWeightedPerformanceDataItems?.length > 0 - ) { + if (this.performanceDataItems) { this.initialize(); } } @@ -120,16 +116,6 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy { }), label: $localize`Portfolio` }, - { - backgroundColor: `rgb(${primaryColorRgb.r}, ${primaryColorRgb.g}, ${primaryColorRgb.b})`, - borderColor: `rgb(${primaryColorRgb.r}, ${primaryColorRgb.g}, ${primaryColorRgb.b})`, - borderWidth: 2, - borderDash: [5, 5], - data: this.timeWeightedPerformanceDataItems.map(({ date, value }) => { - return { x: parseDate(date).getTime(), y: value }; - }), - label: $localize`Portfolio (time-weighted)` - }, { backgroundColor: `rgb(${secondaryColorRgb.r}, ${secondaryColorRgb.g}, ${secondaryColorRgb.b})`, borderColor: `rgb(${secondaryColorRgb.r}, ${secondaryColorRgb.g}, ${secondaryColorRgb.b})`, diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts index 4aee9965a..4b9e3ccd6 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -69,7 +69,6 @@ export class AnalysisPageComponent implements OnDestroy, OnInit { []; public portfolioEvolutionDataLabel = $localize`Investment`; public streaks: PortfolioInvestments['streaks']; - public timeWeightedPerformance: string = 'N'; public top3: PortfolioPosition[]; public unitCurrentStreak: string; public unitLongestStreak: string; @@ -165,12 +164,6 @@ export class AnalysisPageComponent implements OnDestroy, OnInit { }); } - public onTimeWeightedPerformanceChanged(timeWeightedPerformance: string) { - this.timeWeightedPerformance = timeWeightedPerformance; - - this.update(); - } - public onChangeGroupBy(aMode: GroupBy) { this.mode = aMode; this.fetchDividendsAndInvestments(); @@ -263,9 +256,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit { this.dataService .fetchPortfolioPerformance({ filters: this.userService.getFilters(), - range: this.user?.settings?.dateRange, - timeWeightedPerformance: - this.timeWeightedPerformance === 'N' ? false : true + range: this.user?.settings?.dateRange }) .pipe(takeUntil(this.unsubscribeSubject)) .subscribe(({ chart, firstOrderDate, performance }) => { @@ -304,12 +295,6 @@ export class AnalysisPageComponent implements OnDestroy, OnInit { date, value: netPerformanceInPercentageWithCurrencyEffect }); - if ((this.timeWeightedPerformance ?? 'N') !== 'N') { - this.performanceDataItemsTimeWeightedInPercentage.push({ - date, - value: chart[index].timeWeightedPerformance - }); - } } this.isLoadingInvestmentChart = false; diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.html b/apps/client/src/app/pages/portfolio/analysis/analysis-page.html index 491551c13..051334a7f 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.html +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.html @@ -42,36 +42,10 @@ [colorScheme]="user?.settings?.colorScheme" [isLoading]="isLoadingBenchmarkComparator || isLoadingInvestmentChart" [locale]="user?.settings?.locale" - [performanceDataItems]=" - timeWeightedPerformance === 'O' - ? [] - : performanceDataItemsInPercentage - " - [timeWeightedPerformanceDataItems]=" - timeWeightedPerformance === 'N' - ? [] - : performanceDataItemsTimeWeightedInPercentage - " + [performanceDataItems]="performanceDataItemsInPercentage" [user]="user" (benchmarkChanged)="onChangeBenchmark($event)" > -
-
-
- Include time-weighted performance - -
-
-