Browse Source

Task/migrate portfolio summary component to standalone (#5450)

* Migrate portfolio summary component to standalone

* Update changelog
pull/5454/head^2
Kenrick Tandrian 3 days ago
committed by GitHub
parent
commit
37080da364
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-summary/home-summary.component.ts
  3. 12
      apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
  4. 15
      apps/client/src/app/components/portfolio-summary/portfolio-summary.module.ts

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactored the dialog footer component - Refactored the dialog footer component
- Refactored the dialog header component - Refactored the dialog header component
- Refactored the benchmark comparator component to standalone - Refactored the benchmark comparator component to standalone
- Refactored the portfolio summary component to standalone
- Refactored the world map chart component to standalone - Refactored the world map chart component to standalone
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)
- Upgraded the _Stripe_ dependencies - Upgraded the _Stripe_ dependencies

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

@ -1,4 +1,4 @@
import { GfPortfolioSummaryModule } from '@ghostfolio/client/components/portfolio-summary/portfolio-summary.module'; import { GfPortfolioSummaryComponent } from '@ghostfolio/client/components/portfolio-summary/portfolio-summary.component';
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';
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
@ -22,7 +22,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
imports: [GfPortfolioSummaryModule, MatCardModule], imports: [GfPortfolioSummaryComponent, MatCardModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
selector: 'gf-home-summary', selector: 'gf-home-summary',
styleUrls: ['./home-summary.scss'], styleUrls: ['./home-summary.scss'],

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

@ -2,7 +2,9 @@ import { NotificationService } from '@ghostfolio/client/core/notification/notifi
import { getDateFnsLocale, getLocale } from '@ghostfolio/common/helper'; import { getDateFnsLocale, getLocale } from '@ghostfolio/common/helper';
import { PortfolioSummary, User } from '@ghostfolio/common/interfaces'; import { PortfolioSummary, User } from '@ghostfolio/common/interfaces';
import { translate } from '@ghostfolio/ui/i18n'; import { translate } from '@ghostfolio/ui/i18n';
import { GfValueComponent } from '@ghostfolio/ui/value';
import { CommonModule } from '@angular/common';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
@ -11,6 +13,8 @@ import {
OnChanges, OnChanges,
Output Output
} from '@angular/core'; } from '@angular/core';
import { MatTooltipModule } from '@angular/material/tooltip';
import { IonIcon } from '@ionic/angular/standalone';
import { formatDistanceToNow } from 'date-fns'; import { formatDistanceToNow } from 'date-fns';
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
import { import {
@ -19,13 +23,13 @@ import {
} from 'ionicons/icons'; } from 'ionicons/icons';
@Component({ @Component({
selector: 'gf-portfolio-summary',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './portfolio-summary.component.html', imports: [CommonModule, GfValueComponent, IonIcon, MatTooltipModule],
selector: 'gf-portfolio-summary',
styleUrls: ['./portfolio-summary.component.scss'], styleUrls: ['./portfolio-summary.component.scss'],
standalone: false templateUrl: './portfolio-summary.component.html'
}) })
export class PortfolioSummaryComponent implements OnChanges { export class GfPortfolioSummaryComponent implements OnChanges {
@Input() baseCurrency: string; @Input() baseCurrency: string;
@Input() hasPermissionToUpdateUserSettings: boolean; @Input() hasPermissionToUpdateUserSettings: boolean;
@Input() isLoading: boolean; @Input() isLoading: boolean;

15
apps/client/src/app/components/portfolio-summary/portfolio-summary.module.ts

@ -1,15 +0,0 @@
import { GfValueComponent } from '@ghostfolio/ui/value';
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { MatTooltipModule } from '@angular/material/tooltip';
import { PortfolioSummaryComponent } from './portfolio-summary.component';
@NgModule({
declarations: [PortfolioSummaryComponent],
exports: [PortfolioSummaryComponent],
imports: [CommonModule, GfValueComponent, MatTooltipModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class GfPortfolioSummaryModule {}
Loading…
Cancel
Save