From a94d8deb5ce8a97334e3f16fbbffb541ee1e2108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20Jord=C3=A3o?= Date: Sat, 23 Aug 2025 02:40:07 +0100 Subject: [PATCH] migrate register page component to standalone --- apps/client/src/app/app-routing.module.ts | 4 +-- .../pages/register/register-page.component.ts | 22 +++++++++++++--- .../pages/register/register-page.module.ts | 26 ------------------- ...ting.module.ts => register-page.routes.ts} | 11 ++------ 4 files changed, 21 insertions(+), 42 deletions(-) delete mode 100644 apps/client/src/app/pages/register/register-page.module.ts rename apps/client/src/app/pages/register/{register-page-routing.module.ts => register-page.routes.ts} (56%) diff --git a/apps/client/src/app/app-routing.module.ts b/apps/client/src/app/app-routing.module.ts index 70d4f8b30..549a671f7 100644 --- a/apps/client/src/app/app-routing.module.ts +++ b/apps/client/src/app/app-routing.module.ts @@ -120,9 +120,7 @@ const routes: Routes = [ { path: publicRoutes.register.path, loadChildren: () => - import('./pages/register/register-page.module').then( - (m) => m.RegisterPageModule - ) + import('./pages/register/register-page.routes').then((m) => m.routes) }, { path: publicRoutes.resources.path, diff --git a/apps/client/src/app/pages/register/register-page.component.ts b/apps/client/src/app/pages/register/register-page.component.ts index 11b81c32a..77e81b920 100644 --- a/apps/client/src/app/pages/register/register-page.component.ts +++ b/apps/client/src/app/pages/register/register-page.component.ts @@ -3,23 +3,37 @@ import { InternetIdentityService } from '@ghostfolio/client/services/internet-id import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { InfoItem, LineChartItem } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; +import { GfLogoComponent } from '@ghostfolio/ui/logo'; -import { Component, OnDestroy, OnInit } from '@angular/core'; +import { + Component, + CUSTOM_ELEMENTS_SCHEMA, + OnDestroy, + OnInit +} from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { DeviceDetectorService } from 'ngx-device-detector'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ShowAccessTokenDialogParams } from './show-access-token-dialog/interfaces/interfaces'; import { ShowAccessTokenDialog } from './show-access-token-dialog/show-access-token-dialog.component'; +import { ShowAccessTokenDialogModule } from './show-access-token-dialog/show-access-token-dialog.module'; @Component({ host: { class: 'page' }, + imports: [ + GfLogoComponent, + MatButtonModule, + RouterModule, + ShowAccessTokenDialogModule + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], selector: 'gf-register-page', styleUrls: ['./register-page.scss'], - templateUrl: './register-page.html', - standalone: false + templateUrl: './register-page.html' }) export class RegisterPageComponent implements OnDestroy, OnInit { public demoAuthToken: string; diff --git a/apps/client/src/app/pages/register/register-page.module.ts b/apps/client/src/app/pages/register/register-page.module.ts deleted file mode 100644 index 5ce8e3ed9..000000000 --- a/apps/client/src/app/pages/register/register-page.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { GfLogoComponent } from '@ghostfolio/ui/logo'; - -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 { IonIcon } from '@ionic/angular/standalone'; - -import { RegisterPageRoutingModule } from './register-page-routing.module'; -import { RegisterPageComponent } from './register-page.component'; -import { ShowAccessTokenDialogModule } from './show-access-token-dialog/show-access-token-dialog.module'; - -@NgModule({ - declarations: [RegisterPageComponent], - imports: [ - CommonModule, - GfLogoComponent, - IonIcon, - MatButtonModule, - RegisterPageRoutingModule, - RouterModule, - ShowAccessTokenDialogModule - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}) -export class RegisterPageModule {} diff --git a/apps/client/src/app/pages/register/register-page-routing.module.ts b/apps/client/src/app/pages/register/register-page.routes.ts similarity index 56% rename from apps/client/src/app/pages/register/register-page-routing.module.ts rename to apps/client/src/app/pages/register/register-page.routes.ts index 157302999..7afb68512 100644 --- a/apps/client/src/app/pages/register/register-page-routing.module.ts +++ b/apps/client/src/app/pages/register/register-page.routes.ts @@ -1,12 +1,11 @@ import { AuthGuard } from '@ghostfolio/client/core/auth.guard'; import { publicRoutes } from '@ghostfolio/common/routes/routes'; -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; import { RegisterPageComponent } from './register-page.component'; -const routes: Routes = [ +export const routes: Routes = [ { canActivate: [AuthGuard], component: RegisterPageComponent, @@ -14,9 +13,3 @@ const routes: Routes = [ title: publicRoutes.register.title } ]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class RegisterPageRoutingModule {}