diff --git a/CHANGELOG.md b/CHANGELOG.md index 251a51d93..937782a27 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 Register page to standalone + ## 2.193.0 - 2025-08-22 ### Added 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 {}