Browse Source

Task/migrate portfolio performance component to standalone (#5363)

* Migrate portfolio performance component to standalone

* Update changelog
pull/5358/head^2
Kenrick Tandrian 5 days ago
committed by GitHub
parent
commit
7c81042244
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      apps/client/src/app/components/home-overview/home-overview.component.ts
  3. 12
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts
  4. 16
      apps/client/src/app/components/portfolio-performance/portfolio-performance.module.ts

1
CHANGELOG.md

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved the chart of the account detail dialog from experimental to general availability - Moved the chart of the account detail dialog from experimental to general availability
- Improved the dynamic numerical precision for various values in the account detail dialog - Improved the dynamic numerical precision for various values in the account detail dialog
- Extended the accounts endpoint by dividend and interest - Extended the accounts endpoint by dividend and interest
- Refactored the portfolio performance component to standalone
- Improved the language localization for Portuguese (`pt`) - Improved the language localization for Portuguese (`pt`)
- Improved the language localization for Spanish (`es`) - Improved the language localization for Spanish (`es`)

4
apps/client/src/app/components/home-overview/home-overview.component.ts

@ -1,4 +1,4 @@
import { GfPortfolioPerformanceModule } from '@ghostfolio/client/components/portfolio-performance/portfolio-performance.module'; import { GfPortfolioPerformanceComponent } from '@ghostfolio/client/components/portfolio-performance/portfolio-performance.component';
import { LayoutService } from '@ghostfolio/client/core/layout.service'; import { LayoutService } from '@ghostfolio/client/core/layout.service';
import { DataService } from '@ghostfolio/client/services/data.service'; import { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
@ -32,7 +32,7 @@ import { takeUntil } from 'rxjs/operators';
imports: [ imports: [
CommonModule, CommonModule,
GfLineChartComponent, GfLineChartComponent,
GfPortfolioPerformanceModule, GfPortfolioPerformanceComponent,
MatButtonModule, MatButtonModule,
RouterModule RouterModule
], ],

12
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts

@ -8,7 +8,9 @@ import {
PortfolioPerformance, PortfolioPerformance,
ResponseError ResponseError
} from '@ghostfolio/common/interfaces'; } from '@ghostfolio/common/interfaces';
import { GfValueComponent } from '@ghostfolio/ui/value';
import { CommonModule } from '@angular/common';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
@ -17,19 +19,21 @@ import {
OnChanges, OnChanges,
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
import { IonIcon } from '@ionic/angular/standalone';
import { CountUp } from 'countup.js'; import { CountUp } from 'countup.js';
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
import { timeOutline } from 'ionicons/icons'; import { timeOutline } from 'ionicons/icons';
import { isNumber } from 'lodash'; import { isNumber } from 'lodash';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({ @Component({
selector: 'gf-portfolio-performance',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './portfolio-performance.component.html', imports: [CommonModule, GfValueComponent, IonIcon, NgxSkeletonLoaderModule],
selector: 'gf-portfolio-performance',
styleUrls: ['./portfolio-performance.component.scss'], styleUrls: ['./portfolio-performance.component.scss'],
standalone: false templateUrl: './portfolio-performance.component.html'
}) })
export class PortfolioPerformanceComponent implements OnChanges { export class GfPortfolioPerformanceComponent implements OnChanges {
@Input() deviceType: string; @Input() deviceType: string;
@Input() errors: ResponseError['errors']; @Input() errors: ResponseError['errors'];
@Input() isAllTimeHigh: boolean; @Input() isAllTimeHigh: boolean;

16
apps/client/src/app/components/portfolio-performance/portfolio-performance.module.ts

@ -1,16 +0,0 @@
import { GfValueComponent } from '@ghostfolio/ui/value';
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { IonIcon } from '@ionic/angular/standalone';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { PortfolioPerformanceComponent } from './portfolio-performance.component';
@NgModule({
declarations: [PortfolioPerformanceComponent],
exports: [PortfolioPerformanceComponent],
imports: [CommonModule, GfValueComponent, IonIcon, NgxSkeletonLoaderModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class GfPortfolioPerformanceModule {}
Loading…
Cancel
Save