[DSC-287] change app-routing.module.ts inn order to have ServerCheckGuard configured once

This commit is contained in:
Giuseppe Digilio
2021-11-16 19:13:57 +01:00
parent 76ddce7239
commit a323aefc22

View File

@@ -32,112 +32,114 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forRoot([{ RouterModule.forRoot([
path: '', canActivate: [AuthBlockingGuard], { path: '500', component: ThemedPageInternalServerErrorComponent },
{
path: '', canActivate: [ServerCheckGuard, AuthBlockingGuard],
children: [ children: [
{ path: '', redirectTo: '/home', pathMatch: 'full' }, { path: '', redirectTo: '/home', pathMatch: 'full' },
{ {
path: 'reload/:rnd', path: 'reload/:rnd',
component: ThemedPageNotFoundComponent, component: ThemedPageNotFoundComponent,
pathMatch: 'full', pathMatch: 'full',
canActivate: [ServerCheckGuard, ReloadGuard] canActivate: [ReloadGuard]
}, },
{ {
path: 'home', path: 'home',
loadChildren: () => import('./home-page/home-page.module') loadChildren: () => import('./home-page/home-page.module')
.then((m) => m.HomePageModule), .then((m) => m.HomePageModule),
data: { showBreadcrumbs: false }, data: { showBreadcrumbs: false },
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'community-list', path: 'community-list',
loadChildren: () => import('./community-list-page/community-list-page.module') loadChildren: () => import('./community-list-page/community-list-page.module')
.then((m) => m.CommunityListPageModule), .then((m) => m.CommunityListPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'id', path: 'id',
loadChildren: () => import('./lookup-by-id/lookup-by-id.module') loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
.then((m) => m.LookupIdModule), .then((m) => m.LookupIdModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'handle', path: 'handle',
loadChildren: () => import('./lookup-by-id/lookup-by-id.module') loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
.then((m) => m.LookupIdModule), .then((m) => m.LookupIdModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: REGISTER_PATH, path: REGISTER_PATH,
loadChildren: () => import('./register-page/register-page.module') loadChildren: () => import('./register-page/register-page.module')
.then((m) => m.RegisterPageModule), .then((m) => m.RegisterPageModule),
canActivate: [ServerCheckGuard, SiteRegisterGuard] canActivate: [SiteRegisterGuard]
}, },
{ {
path: FORGOT_PASSWORD_PATH, path: FORGOT_PASSWORD_PATH,
loadChildren: () => import('./forgot-password/forgot-password.module') loadChildren: () => import('./forgot-password/forgot-password.module')
.then((m) => m.ForgotPasswordModule), .then((m) => m.ForgotPasswordModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: COMMUNITY_MODULE_PATH, path: COMMUNITY_MODULE_PATH,
loadChildren: () => import('./community-page/community-page.module') loadChildren: () => import('./community-page/community-page.module')
.then((m) => m.CommunityPageModule), .then((m) => m.CommunityPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: COLLECTION_MODULE_PATH, path: COLLECTION_MODULE_PATH,
loadChildren: () => import('./collection-page/collection-page.module') loadChildren: () => import('./collection-page/collection-page.module')
.then((m) => m.CollectionPageModule), .then((m) => m.CollectionPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: ITEM_MODULE_PATH, path: ITEM_MODULE_PATH,
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: [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: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: LEGACY_BITSTREAM_MODULE_PATH, path: LEGACY_BITSTREAM_MODULE_PATH,
loadChildren: () => import('./bitstream-page/bitstream-page.module') loadChildren: () => import('./bitstream-page/bitstream-page.module')
.then((m) => m.BitstreamPageModule), .then((m) => m.BitstreamPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: BITSTREAM_MODULE_PATH, path: BITSTREAM_MODULE_PATH,
loadChildren: () => import('./bitstream-page/bitstream-page.module') loadChildren: () => import('./bitstream-page/bitstream-page.module')
.then((m) => m.BitstreamPageModule), .then((m) => m.BitstreamPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'mydspace', path: 'mydspace',
loadChildren: () => import('./my-dspace-page/my-dspace-page.module') loadChildren: () => import('./my-dspace-page/my-dspace-page.module')
.then((m) => m.MyDSpacePageModule), .then((m) => m.MyDSpacePageModule),
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard] canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'search', path: 'search',
loadChildren: () => import('./search-page/search-page-routing.module') loadChildren: () => import('./search-page/search-page-routing.module')
.then((m) => m.SearchPageRoutingModule), .then((m) => m.SearchPageRoutingModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'browse', path: 'browse',
loadChildren: () => import('./browse-by/browse-by-page.module') loadChildren: () => import('./browse-by/browse-by-page.module')
.then((m) => m.BrowseByPageModule), .then((m) => m.BrowseByPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: ADMIN_MODULE_PATH, path: ADMIN_MODULE_PATH,
loadChildren: () => import('./admin/admin.module') loadChildren: () => import('./admin/admin.module')
.then((m) => m.AdminModule), .then((m) => m.AdminModule),
canActivate: [ServerCheckGuard, SiteAdministratorGuard, EndUserAgreementCurrentUserGuard] canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'login', path: 'login',
@@ -155,37 +157,37 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
path: 'submit', path: 'submit',
loadChildren: () => import('./submit-page/submit-page.module') loadChildren: () => import('./submit-page/submit-page.module')
.then((m) => m.SubmitPageModule), .then((m) => m.SubmitPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'import-external', path: 'import-external',
loadChildren: () => import('./import-external-page/import-external-page.module') loadChildren: () => import('./import-external-page/import-external-page.module')
.then((m) => m.ImportExternalPageModule), .then((m) => m.ImportExternalPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: 'workspaceitems', path: 'workspaceitems',
loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page.module') loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page.module')
.then((m) => m.WorkspaceitemsEditPageModule), .then((m) => m.WorkspaceitemsEditPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: WORKFLOW_ITEM_MODULE_PATH, path: WORKFLOW_ITEM_MODULE_PATH,
loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module') loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module')
.then((m) => m.WorkflowItemsEditPageModule), .then((m) => m.WorkflowItemsEditPageModule),
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard] canActivate: [EndUserAgreementCurrentUserGuard]
}, },
{ {
path: PROFILE_MODULE_PATH, path: PROFILE_MODULE_PATH,
loadChildren: () => import('./profile-page/profile-page.module') loadChildren: () => import('./profile-page/profile-page.module')
.then((m) => m.ProfilePageModule), .then((m) => m.ProfilePageModule),
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard] canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
}, },
{ {
path: PROCESS_MODULE_PATH, path: PROCESS_MODULE_PATH,
loadChildren: () => import('./process-page/process-page.module') loadChildren: () => import('./process-page/process-page.module')
.then((m) => m.ProcessPageModule), .then((m) => m.ProcessPageModule),
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard] canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
}, },
{ {
path: INFO_MODULE_PATH, path: INFO_MODULE_PATH,
@@ -195,7 +197,7 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
{ {
path: REQUEST_COPY_MODULE_PATH, path: REQUEST_COPY_MODULE_PATH,
loadChildren: () => import('./request-copy/request-copy.module').then((m) => m.RequestCopyModule), loadChildren: () => import('./request-copy/request-copy.module').then((m) => m.RequestCopyModule),
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard] canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
}, },
{ {
path: FORBIDDEN_PATH, path: FORBIDDEN_PATH,
@@ -210,9 +212,9 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
{ {
path: ACCESS_CONTROL_MODULE_PATH, path: ACCESS_CONTROL_MODULE_PATH,
loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule), loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule),
canActivate: [ServerCheckGuard, GroupAdministratorGuard], canActivate: [GroupAdministratorGuard],
}, },
{ path: '500', component: ThemedPageInternalServerErrorComponent },
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent }, { path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
] ]
} }