[DSC-287] reformat app-routing.module code

This commit is contained in:
Giuseppe Digilio
2021-11-15 19:02:10 +01:00
parent 25a51c9764
commit 81c4403ee6

View File

@@ -11,10 +11,11 @@ import {
FORBIDDEN_PATH, FORBIDDEN_PATH,
FORGOT_PASSWORD_PATH, FORGOT_PASSWORD_PATH,
INFO_MODULE_PATH, INFO_MODULE_PATH,
LEGACY_BITSTREAM_MODULE_PATH,
PROFILE_MODULE_PATH, PROFILE_MODULE_PATH,
REGISTER_PATH, REGISTER_PATH,
REQUEST_COPY_MODULE_PATH,
WORKFLOW_ITEM_MODULE_PATH, WORKFLOW_ITEM_MODULE_PATH,
LEGACY_BITSTREAM_MODULE_PATH, REQUEST_COPY_MODULE_PATH,
} from './app-routing-paths'; } from './app-routing-paths';
import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths'; import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths';
import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths'; import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths';
@@ -29,14 +30,18 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component'; import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
import { ServerCheckGuard } from './core/server-check/server-check.guard'; import { ServerCheckGuard } from './core/server-check/server-check.guard';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forRoot([{ RouterModule.forRoot([{
path: '', canActivate: [AuthBlockingGuard], path: '', canActivate: [AuthBlockingGuard],
children: [ children: [
{ path: '', redirectTo: '/home', pathMatch: 'full' }, { path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'reload/:rnd', component: ThemedPageNotFoundComponent, pathMatch: 'full', canActivate: [ServerCheckGuard, ReloadGuard] }, {
path: 'reload/:rnd',
component: ThemedPageNotFoundComponent,
pathMatch: 'full',
canActivate: [ServerCheckGuard, ReloadGuard]
},
{ {
path: 'home', path: 'home',
loadChildren: () => import('./home-page/home-page.module') loadChildren: () => import('./home-page/home-page.module')
@@ -92,7 +97,8 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
.then((m) => m.ItemPageModule), .then((m) => m.ItemPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
}, },
{ path: 'entities/:entity-type', {
path: 'entities/:entity-type',
loadChildren: () => import('./item-page/item-page.module') loadChildren: () => import('./item-page/item-page.module')
.then((m) => m.ItemPageModule), .then((m) => m.ItemPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
@@ -208,7 +214,8 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
}, },
{ path: '500', component: ThemedPageInternalServerErrorComponent }, { path: '500', component: ThemedPageInternalServerErrorComponent },
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent }, { path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
]} ]
}
], { ], {
onSameUrlNavigation: 'reload', onSameUrlNavigation: 'reload',
}) })