Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/migrate investment chart component to standalone (#5490)

Raj Gupta4aafc0159410
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2360b4ba66..03e3661050 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactored the markets page to standalone
- Refactored the fear and greed index component to standalone
- Refactored the header component to standalone
+- Refactored the investment chart component to standalone
- Refactored the rule component to standalone
- Refactored the rules component to standalone
- Refactored the subscription interstitial dialog component to standalone
diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
index 954bcd27b8..bdc2424f5f 100644
--- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
+++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
@@ -2,7 +2,7 @@ import { CreateAccountBalanceDto } from '@ghostfolio/api/app/account-balance/cre
import { Activity } from '@ghostfolio/api/app/order/interfaces/activities.interface';
import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component';
import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component';
-import { GfInvestmentChartModule } from '@ghostfolio/client/components/investment-chart/investment-chart.module';
+import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component';
import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config';
@@ -64,7 +64,7 @@ import { AccountDetailDialogParams } from './interfaces/interfaces';
GfDialogFooterComponent,
GfDialogHeaderComponent,
GfHoldingsTableComponent,
- GfInvestmentChartModule,
+ GfInvestmentChartComponent,
GfValueComponent,
IonIcon,
MatButtonModule,
diff --git a/apps/client/src/app/components/investment-chart/investment-chart.component.ts b/apps/client/src/app/components/investment-chart/investment-chart.component.ts
index 9fd245485a..5492ddd4c6 100644
--- a/apps/client/src/app/components/investment-chart/investment-chart.component.ts
+++ b/apps/client/src/app/components/investment-chart/investment-chart.component.ts
@@ -16,6 +16,7 @@ import { LineChartItem } from '@ghostfolio/common/interfaces';
import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface';
import { ColorScheme, GroupBy } from '@ghostfolio/common/types';
+import { CommonModule } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
@@ -40,15 +41,16 @@ import {
import 'chartjs-adapter-date-fns';
import annotationPlugin from 'chartjs-plugin-annotation';
import { isAfter } from 'date-fns';
+import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({
- selector: 'gf-investment-chart',
changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './investment-chart.component.html',
+ imports: [CommonModule, NgxSkeletonLoaderModule],
+ selector: 'gf-investment-chart',
styleUrls: ['./investment-chart.component.scss'],
- standalone: false
+ templateUrl: './investment-chart.component.html'
})
-export class InvestmentChartComponent implements OnChanges, OnDestroy {
+export class GfInvestmentChartComponent implements OnChanges, OnDestroy {
@Input() benchmarkDataItems: InvestmentItem[] = [];
@Input() benchmarkDataLabel = '';
@Input() colorScheme: ColorScheme;
diff --git a/apps/client/src/app/components/investment-chart/investment-chart.module.ts b/apps/client/src/app/components/investment-chart/investment-chart.module.ts
deleted file mode 100644
index 2af174b1cb..0000000000
--- a/apps/client/src/app/components/investment-chart/investment-chart.module.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
-
-import { InvestmentChartComponent } from './investment-chart.component';
-
-@NgModule({
- declarations: [InvestmentChartComponent],
- exports: [InvestmentChartComponent],
- imports: [CommonModule, NgxSkeletonLoaderModule]
-})
-export class GfInvestmentChartModule {}
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 89f294a35f..26d474f73c 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
@@ -1,5 +1,5 @@
import { GfBenchmarkComparatorComponent } from '@ghostfolio/client/components/benchmark-comparator/benchmark-comparator.component';
-import { GfInvestmentChartModule } from '@ghostfolio/client/components/investment-chart/investment-chart.module';
+import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component';
import { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
@@ -47,7 +47,7 @@ import { takeUntil } from 'rxjs/operators';
@Component({
imports: [
GfBenchmarkComparatorComponent,
- GfInvestmentChartModule,
+ GfInvestmentChartComponent,
GfPremiumIndicatorComponent,
GfToggleComponent,
GfValueComponent,