From 239bd09cbd7aa08f30d1c4a15007b7e0959ba0bd Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 11 Nov 2021 21:43:17 +0100 Subject: [PATCH] Feature/move market mood to tab (#463) * Move market mood to tab * Update changelog --- CHANGELOG.md | 1 + .../interfaces/interfaces.ts | 1 - .../performance-chart-dialog.component.ts | 4 -- .../performance-chart-dialog.html | 10 +-- .../performance-chart-dialog.module.ts | 2 - .../src/app/pages/home/home-page.component.ts | 33 ---------- apps/client/src/app/pages/home/home-page.html | 62 +++++++++++++------ .../src/app/pages/home/home-page.module.ts | 2 + 8 files changed, 47 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cec45a7a..d565dca0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Adapted the decimal places for cryptocurrencies in the position detail dialog +- Moved the _Fear & Greed Index_ (market mood) to a new tab on the home page ## 1.73.0 - 10.11.2021 diff --git a/apps/client/src/app/components/performance-chart-dialog/interfaces/interfaces.ts b/apps/client/src/app/components/performance-chart-dialog/interfaces/interfaces.ts index d58e38c95..4795d68cf 100644 --- a/apps/client/src/app/components/performance-chart-dialog/interfaces/interfaces.ts +++ b/apps/client/src/app/components/performance-chart-dialog/interfaces/interfaces.ts @@ -2,6 +2,5 @@ import { LineChartItem } from '@ghostfolio/ui/line-chart/interfaces/line-chart.i export interface PositionDetailDialogParams { deviceType: string; - fearAndGreedIndex: number; historicalDataItems: LineChartItem[]; } diff --git a/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.component.ts b/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.component.ts index ecffbe726..301b867ca 100644 --- a/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.component.ts +++ b/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.component.ts @@ -22,13 +22,11 @@ import { PositionDetailDialogParams } from './interfaces/interfaces'; }) export class PerformanceChartDialog { public benchmarkDataItems: LineChartItem[]; - public benchmarkLabel = 'S&P 500'; public benchmarkSymbol = 'VOO'; public currency: string; public firstBuyDate: string; public marketPrice: number; public historicalDataItems: LineChartItem[]; - public title: string; private unsubscribeSubject = new Subject(); @@ -83,8 +81,6 @@ export class PerformanceChartDialog { this.changeDetectorRef.markForCheck(); }); - - this.title = `Performance vs. ${this.benchmarkLabel}`; } public onClose(): void { diff --git a/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.html b/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.html index 67ed96220..dff26c202 100644 --- a/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.html +++ b/apps/client/src/app/components/performance-chart-dialog/performance-chart-dialog.html @@ -1,7 +1,7 @@ @@ -11,7 +11,6 @@ class="mb-4" symbol="Performance" [benchmarkDataItems]="benchmarkDataItems" - [benchmarkLabel]="benchmarkLabel" [historicalDataItems]="historicalDataItems" [showGradient]="true" [showLegend]="true" @@ -19,13 +18,6 @@ [showYAxis]="false" > - -
- -
{ - if (params['performanceChartDialog']) { - this.openDialog(); - } - }); - this.userService.stateChanged .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((state) => { @@ -172,25 +158,6 @@ export class HomePageComponent implements OnDestroy, OnInit { this.unsubscribeSubject.complete(); } - private openDialog(): void { - const dialogRef = this.dialog.open(PerformanceChartDialog, { - autoFocus: false, - data: { - deviceType: this.deviceType, - fearAndGreedIndex: this.fearAndGreedIndex, - historicalDataItems: this.historicalDataItems - }, - width: '50rem' - }); - - dialogRef - .afterClosed() - .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe(() => { - this.router.navigate(['.'], { relativeTo: this.route }); - }); - } - private update() { if (this.currentTabIndex === 0) { this.isLoadingPerformance = true; diff --git a/apps/client/src/app/pages/home/home-page.html b/apps/client/src/app/pages/home/home-page.html index e2c351cfe..e37e0c4b1 100644 --- a/apps/client/src/app/pages/home/home-page.html +++ b/apps/client/src/app/pages/home/home-page.html @@ -23,12 +23,7 @@ " >
- +
- -
-
- +
+
+ +
@@ -140,4 +135,33 @@
+ + + + +
+
+
+ + + + + +
+
+
+
diff --git a/apps/client/src/app/pages/home/home-page.module.ts b/apps/client/src/app/pages/home/home-page.module.ts index 58144cd3f..d6d27bb3f 100644 --- a/apps/client/src/app/pages/home/home-page.module.ts +++ b/apps/client/src/app/pages/home/home-page.module.ts @@ -4,6 +4,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; +import { GfFearAndGreedIndexModule } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.module'; import { GfPerformanceChartDialogModule } from '@ghostfolio/client/components/performance-chart-dialog/performance-chart-dialog.module'; import { GfPortfolioPerformanceModule } from '@ghostfolio/client/components/portfolio-performance/portfolio-performance.module'; import { GfPortfolioSummaryModule } from '@ghostfolio/client/components/portfolio-summary/portfolio-summary.module'; @@ -20,6 +21,7 @@ import { HomePageComponent } from './home-page.component'; exports: [], imports: [ CommonModule, + GfFearAndGreedIndexModule, GfLineChartModule, GfNoTransactionsInfoModule, GfPerformanceChartDialogModule,