From 1845e016c8641c752da74f2b6562f51f34c9f283 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 10 Sep 2025 19:01:33 +0200 Subject: [PATCH] Task/migrate fear and greed index component to standalone (#5485) * Migrate fear and greed index component to standalone * Update changelog --- CHANGELOG.md | 1 + .../fear-and-greed-index.component.ts | 10 ++++++---- .../fear-and-greed-index.module.ts | 12 ------------ .../components/home-market/home-market.component.ts | 4 ++-- .../src/app/components/markets/markets.component.ts | 4 ++-- 5 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.module.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fba0cb84..2360b4ba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Extended the variations of the interstitials for the subscription - Renamed the job identifier column in the jobs queue view of the admin control panel - Refactored the markets page to standalone +- Refactored the fear and greed index component to standalone - Refactored the header component to standalone - Refactored the rule component to standalone - Refactored the rules component to standalone diff --git a/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts b/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts index 96cb272a0..51a984660 100644 --- a/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts +++ b/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts @@ -1,21 +1,23 @@ import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper'; import { translate } from '@ghostfolio/ui/i18n'; +import { CommonModule } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; +import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; @Component({ - selector: 'gf-fear-and-greed-index', changeDetection: ChangeDetectionStrategy.OnPush, - templateUrl: './fear-and-greed-index.component.html', + imports: [CommonModule, NgxSkeletonLoaderModule], + selector: 'gf-fear-and-greed-index', styleUrls: ['./fear-and-greed-index.component.scss'], - standalone: false + templateUrl: './fear-and-greed-index.component.html' }) -export class FearAndGreedIndexComponent implements OnChanges { +export class GfFearAndGreedIndexComponent implements OnChanges { @Input() fearAndGreedIndex: number; public fearAndGreedIndexEmoji: string; diff --git a/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.module.ts b/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.module.ts deleted file mode 100644 index 426326344..000000000 --- a/apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.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 { FearAndGreedIndexComponent } from './fear-and-greed-index.component'; - -@NgModule({ - declarations: [FearAndGreedIndexComponent], - exports: [FearAndGreedIndexComponent], - imports: [CommonModule, NgxSkeletonLoaderModule] -}) -export class GfFearAndGreedIndexModule {} diff --git a/apps/client/src/app/components/home-market/home-market.component.ts b/apps/client/src/app/components/home-market/home-market.component.ts index c754935df..f0aa4352d 100644 --- a/apps/client/src/app/components/home-market/home-market.component.ts +++ b/apps/client/src/app/components/home-market/home-market.component.ts @@ -1,4 +1,4 @@ -import { GfFearAndGreedIndexModule } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.module'; +import { GfFearAndGreedIndexComponent } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config'; @@ -27,7 +27,7 @@ import { takeUntil } from 'rxjs/operators'; @Component({ imports: [ GfBenchmarkComponent, - GfFearAndGreedIndexModule, + GfFearAndGreedIndexComponent, GfLineChartComponent ], schemas: [CUSTOM_ELEMENTS_SCHEMA], diff --git a/apps/client/src/app/components/markets/markets.component.ts b/apps/client/src/app/components/markets/markets.component.ts index 91c28e1c7..054ee79eb 100644 --- a/apps/client/src/app/components/markets/markets.component.ts +++ b/apps/client/src/app/components/markets/markets.component.ts @@ -1,4 +1,4 @@ -import { GfFearAndGreedIndexModule } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.module'; +import { GfFearAndGreedIndexComponent } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { resetHours } from '@ghostfolio/common/helper'; @@ -30,7 +30,7 @@ import { takeUntil } from 'rxjs/operators'; changeDetection: ChangeDetectionStrategy.OnPush, imports: [ GfBenchmarkComponent, - GfFearAndGreedIndexModule, + GfFearAndGreedIndexComponent, GfLineChartComponent, GfToggleComponent ],