[DURACOM-191] change routing for community-list-page

can't delete module - for now - since it has providers in it
This commit is contained in:
Andrea Barbasso
2024-01-10 10:04:47 +01:00
parent d1e986a443
commit a2d66c6e34
3 changed files with 15 additions and 24 deletions

View File

@@ -74,14 +74,14 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
}, },
{ {
path: 'id', path: 'id',
loadChildren: () => import('./lookup-by-id/lookup-by-id.module') loadChildren: () => import('./lookup-by-id/lookup-by-id-routes')
.then((m) => m.LookupIdModule), .then((m) => m.ROUTES),
canActivate: [EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'handle', path: 'handle',
loadChildren: () => import('./lookup-by-id/lookup-by-id.module') loadChildren: () => import('./lookup-by-id/lookup-by-id-routes')
.then((m) => m.LookupIdModule), .then((m) => m.ROUTES),
canActivate: [EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {

View File

@@ -1,26 +1,19 @@
import { LookupGuard } from './lookup-guard'; import { LookupGuard } from './lookup-guard';
import { NgModule } from '@angular/core'; import { Route, UrlSegment } from '@angular/router';
import { RouterModule, UrlSegment } from '@angular/router';
import { isNotEmpty } from '../shared/empty.util'; import { isNotEmpty } from '../shared/empty.util';
import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component'; import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component';
@NgModule({ export const ROUTES: Route[] = [
imports: [ {
RouterModule.forChild([ matcher: urlMatcher,
{ providers: [
matcher: urlMatcher, LookupGuard
canActivate: [LookupGuard], ],
component: ThemedObjectNotFoundComponent } canActivate: [LookupGuard],
]) component: ThemedObjectNotFoundComponent
], }
providers: [ ];
LookupGuard
]
})
export class LookupRoutingModule {
}
export function urlMatcher(url) { export function urlMatcher(url) {
// The expected path is :idType/:id // The expected path is :idType/:id

View File

@@ -1,13 +1,11 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { LookupRoutingModule } from './lookup-by-id-routing.module';
import { ObjectNotFoundComponent } from './objectnotfound/objectnotfound.component'; import { ObjectNotFoundComponent } from './objectnotfound/objectnotfound.component';
import { DsoRedirectService } from '../core/data/dso-redirect.service'; import { DsoRedirectService } from '../core/data/dso-redirect.service';
import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component'; import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component';
@NgModule({ @NgModule({
imports: [ imports: [
LookupRoutingModule,
CommonModule, CommonModule,
ObjectNotFoundComponent, ObjectNotFoundComponent,
ThemedObjectNotFoundComponent ThemedObjectNotFoundComponent