Browse Source

Feature/migrate ZEN page component to standalone (#5410)

* Migrate ZEN page component to standalone

* Update changelog
main
David Requeno 1 day ago
committed by GitHub
parent
commit
620929fe32
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 2
      apps/client/src/app/app-routing.module.ts
  3. 10
      apps/client/src/app/pages/zen/zen-page.component.ts
  4. 26
      apps/client/src/app/pages/zen/zen-page.module.ts
  5. 15
      apps/client/src/app/pages/zen/zen-page.routes.ts

6
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

2
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

10
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;

26
apps/client/src/app/pages/zen/zen-page.module.ts

@ -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 {}

15
apps/client/src/app/pages/zen/zen-page-routing.module.ts → 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 {}
Loading…
Cancel
Save