[DURACOM-191] change routing for register-page, delete register-page.module.ts

This commit is contained in:
Andrea Barbasso
2024-01-10 10:14:43 +01:00
parent a2d66c6e34
commit d73fc0f073
4 changed files with 31 additions and 67 deletions

View File

@@ -86,8 +86,8 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
},
{
path: REGISTER_PATH,
loadChildren: () => import('./register-page/register-page.module')
.then((m) => m.RegisterPageModule),
loadChildren: () => import('./register-page/register-page-routes')
.then((m) => m.ROUTES),
canActivate: [SiteRegisterGuard]
},
{

View File

@@ -0,0 +1,29 @@
import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component';
import { ItemPageResolver } from '../item-page/item-page.resolver';
import { EndUserAgreementCookieGuard } from '../core/end-user-agreement/end-user-agreement-cookie.guard';
import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component';
import { RegistrationGuard } from './registration.guard';
import { Route } from '@angular/router';
export const ROUTES: Route[] = [
{
path: '',
component: ThemedRegisterEmailComponent,
providers: [
ItemPageResolver
],
data: {title: 'register-email.title'},
},
{
path: ':token',
component: ThemedCreateProfileComponent,
providers: [
ItemPageResolver
],
canActivate: [
RegistrationGuard,
EndUserAgreementCookieGuard,
],
}
];

View File

@@ -1,35 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component';
import { ItemPageResolver } from '../item-page/item-page.resolver';
import { EndUserAgreementCookieGuard } from '../core/end-user-agreement/end-user-agreement-cookie.guard';
import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component';
import { RegistrationGuard } from './registration.guard';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: ThemedRegisterEmailComponent,
data: {title: 'register-email.title'},
},
{
path: ':token',
component: ThemedCreateProfileComponent,
canActivate: [
RegistrationGuard,
EndUserAgreementCookieGuard,
],
}
])
],
providers: [
ItemPageResolver
]
})
/**
* Module related to the navigation to components used to register a new user
*/
export class RegisterPageRoutingModule {
}

View File

@@ -1,30 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RegisterPageRoutingModule } from './register-page-routing.module';
import { RegisterEmailComponent } from './register-email/register-email.component';
import { CreateProfileComponent } from './create-profile/create-profile.component';
import { RegisterEmailFormModule } from '../register-email-form/register-email-form.module';
import { ProfilePageModule } from '../profile-page/profile-page.module';
import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component';
import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component';
@NgModule({
imports: [
CommonModule,
RegisterPageRoutingModule,
RegisterEmailFormModule,
ProfilePageModule,
RegisterEmailComponent,
ThemedRegisterEmailComponent,
CreateProfileComponent,
ThemedCreateProfileComponent
],
providers: []
})
/**
* Module related to components used to register a new user
*/
export class RegisterPageModule {
}