diff --git a/CHANGELOG.md b/CHANGELOG.md index d5ff5fad7..399d2a07c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Refactored the _ZEN_ page to standalone + ## 2.194.0 - 2025-08-27 ### Added diff --git a/apps/client/src/app/app-routing.module.ts b/apps/client/src/app/app-routing.module.ts index 9d5123d1b..dae10fbf1 100644 --- a/apps/client/src/app/app-routing.module.ts +++ b/apps/client/src/app/app-routing.module.ts @@ -141,7 +141,7 @@ const routes: Routes = [ { path: internalRoutes.zen.path, loadChildren: () => - import('./pages/zen/zen-page.module').then((m) => m.ZenPageModule) + import('./pages/zen/zen-page.routes').then((m) => m.routes) }, { // wildcard, if requested url doesn't match any paths for routes defined diff --git a/apps/client/src/app/pages/zen/zen-page.component.ts b/apps/client/src/app/pages/zen/zen-page.component.ts index 397a2eb47..0224c13c7 100644 --- a/apps/client/src/app/pages/zen/zen-page.component.ts +++ b/apps/client/src/app/pages/zen/zen-page.component.ts @@ -2,7 +2,11 @@ import { UserService } from '@ghostfolio/client/services/user/user.service'; import { TabConfiguration, User } from '@ghostfolio/common/interfaces'; import { internalRoutes } from '@ghostfolio/common/routes/routes'; +import { CommonModule } from '@angular/common'; import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; +import { MatTabsModule } from '@angular/material/tabs'; +import { RouterModule } from '@angular/router'; +import { IonIcon } from '@ionic/angular/standalone'; import { addIcons } from 'ionicons'; import { analyticsOutline, walletOutline } from 'ionicons/icons'; import { DeviceDetectorService } from 'ngx-device-detector'; @@ -11,12 +15,12 @@ import { takeUntil } from 'rxjs/operators'; @Component({ host: { class: 'page has-tabs' }, + imports: [CommonModule, IonIcon, MatTabsModule, RouterModule], selector: 'gf-zen-page', styleUrls: ['./zen-page.scss'], - templateUrl: './zen-page.html', - standalone: false + templateUrl: './zen-page.html' }) -export class ZenPageComponent implements OnDestroy, OnInit { +export class GfZenPageComponent implements OnDestroy, OnInit { public deviceType: string; public tabs: TabConfiguration[] = []; public user: User; diff --git a/apps/client/src/app/pages/zen/zen-page.module.ts b/apps/client/src/app/pages/zen/zen-page.module.ts deleted file mode 100644 index 2346e3705..000000000 --- a/apps/client/src/app/pages/zen/zen-page.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { GfHomeHoldingsComponent } from '@ghostfolio/client/components/home-holdings/home-holdings.component'; -import { GfHomeOverviewComponent } from '@ghostfolio/client/components/home-overview/home-overview.component'; - -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { IonIcon } from '@ionic/angular/standalone'; - -import { ZenPageRoutingModule } from './zen-page-routing.module'; -import { ZenPageComponent } from './zen-page.component'; - -@NgModule({ - declarations: [ZenPageComponent], - imports: [ - CommonModule, - GfHomeHoldingsComponent, - GfHomeOverviewComponent, - IonIcon, - MatTabsModule, - RouterModule, - ZenPageRoutingModule - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}) -export class ZenPageModule {} diff --git a/apps/client/src/app/pages/zen/zen-page-routing.module.ts b/apps/client/src/app/pages/zen/zen-page.routes.ts similarity index 68% rename from apps/client/src/app/pages/zen/zen-page-routing.module.ts rename to apps/client/src/app/pages/zen/zen-page.routes.ts index 84099425c..60e163ca4 100644 --- a/apps/client/src/app/pages/zen/zen-page-routing.module.ts +++ b/apps/client/src/app/pages/zen/zen-page.routes.ts @@ -3,12 +3,11 @@ import { GfHomeOverviewComponent } from '@ghostfolio/client/components/home-over import { AuthGuard } from '@ghostfolio/client/core/auth.guard'; import { internalRoutes } from '@ghostfolio/common/routes/routes'; -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; -import { ZenPageComponent } from './zen-page.component'; +import { GfZenPageComponent } from './zen-page.component'; -const routes: Routes = [ +export const routes: Routes = [ { canActivate: [AuthGuard], children: [ @@ -22,14 +21,8 @@ const routes: Routes = [ title: internalRoutes.home.subRoutes.holdings.title } ], - component: ZenPageComponent, + component: GfZenPageComponent, path: '', title: internalRoutes.zen.title } ]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class ZenPageRoutingModule {}