Browse Source

fix(app): make home watchlist a standalone component

pull/4604/head
KenTandrian 4 months ago
parent
commit
7373cf50bd
  1. 11
      apps/client/src/app/components/home-watchlist/home-watchlist.component.ts
  2. 23
      apps/client/src/app/components/home-watchlist/home-watchlist.module.ts
  3. 4
      apps/client/src/app/pages/home/home-page.module.ts

11
apps/client/src/app/components/home-watchlist/home-watchlist.component.ts

@ -1,16 +1,20 @@
import { DataService } from '@ghostfolio/client/services/data.service'; import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { Benchmark, User } from '@ghostfolio/common/interfaces'; import { Benchmark, User } from '@ghostfolio/common/interfaces';
import { GfBenchmarkComponent } from '@ghostfolio/ui/benchmark';
import { CommonModule } from '@angular/common';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
CUSTOM_ELEMENTS_SCHEMA,
OnDestroy, OnDestroy,
OnInit OnInit
} from '@angular/core'; } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@ -20,10 +24,11 @@ import { CreateWatchlistItemDialogParams } from './create-watchlist-item-dialog/
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, GfBenchmarkComponent, MatButtonModule, RouterModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
selector: 'gf-home-watchlist', selector: 'gf-home-watchlist',
styleUrls: ['./home-watchlist.scss'], styleUrls: ['./home-watchlist.scss'],
templateUrl: './home-watchlist.html', templateUrl: './home-watchlist.html'
standalone: false
}) })
export class HomeWatchlistComponent implements OnDestroy, OnInit { export class HomeWatchlistComponent implements OnDestroy, OnInit {
public deviceType: string; public deviceType: string;

23
apps/client/src/app/components/home-watchlist/home-watchlist.module.ts

@ -1,23 +0,0 @@
import { GfBenchmarkComponent } from '@ghostfolio/ui/benchmark';
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { RouterModule } from '@angular/router';
import { CreateWatchlistItemDialogComponent } from './create-watchlist-item-dialog/create-watchlist-item-dialog.component';
import { HomeWatchlistComponent } from './home-watchlist.component';
@NgModule({
declarations: [HomeWatchlistComponent],
exports: [HomeWatchlistComponent],
imports: [
CommonModule,
GfBenchmarkComponent,
CreateWatchlistItemDialogComponent,
MatButtonModule,
RouterModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class GfHomeWatchlistModule {}

4
apps/client/src/app/pages/home/home-page.module.ts

@ -2,7 +2,7 @@ import { GfHomeHoldingsModule } from '@ghostfolio/client/components/home-holding
import { GfHomeMarketModule } from '@ghostfolio/client/components/home-market/home-market.module'; import { GfHomeMarketModule } from '@ghostfolio/client/components/home-market/home-market.module';
import { GfHomeOverviewModule } from '@ghostfolio/client/components/home-overview/home-overview.module'; import { GfHomeOverviewModule } from '@ghostfolio/client/components/home-overview/home-overview.module';
import { GfHomeSummaryModule } from '@ghostfolio/client/components/home-summary/home-summary.module'; import { GfHomeSummaryModule } from '@ghostfolio/client/components/home-summary/home-summary.module';
import { GfHomeWatchlistModule } from '@ghostfolio/client/components/home-watchlist/home-watchlist.module'; import { HomeWatchlistComponent } from '@ghostfolio/client/components/home-watchlist/home-watchlist.component';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
@ -20,8 +20,8 @@ import { HomePageComponent } from './home-page.component';
GfHomeMarketModule, GfHomeMarketModule,
GfHomeOverviewModule, GfHomeOverviewModule,
GfHomeSummaryModule, GfHomeSummaryModule,
GfHomeWatchlistModule,
HomePageRoutingModule, HomePageRoutingModule,
HomeWatchlistComponent,
MatTabsModule, MatTabsModule,
RouterModule RouterModule
], ],

Loading…
Cancel
Save