mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[DSC-287] change app-routing.module.ts inn order to have ServerCheckGuard configured once
This commit is contained in:
@@ -32,190 +32,192 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
|
|||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot([{
|
RouterModule.forRoot([
|
||||||
path: '', canActivate: [AuthBlockingGuard],
|
{ path: '500', component: ThemedPageInternalServerErrorComponent },
|
||||||
children: [
|
{
|
||||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
path: '', canActivate: [ServerCheckGuard, AuthBlockingGuard],
|
||||||
{
|
children: [
|
||||||
path: 'reload/:rnd',
|
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||||
component: ThemedPageNotFoundComponent,
|
{
|
||||||
pathMatch: 'full',
|
path: 'reload/:rnd',
|
||||||
canActivate: [ServerCheckGuard, ReloadGuard]
|
component: ThemedPageNotFoundComponent,
|
||||||
},
|
pathMatch: 'full',
|
||||||
{
|
canActivate: [ReloadGuard]
|
||||||
path: 'home',
|
},
|
||||||
loadChildren: () => import('./home-page/home-page.module')
|
{
|
||||||
.then((m) => m.HomePageModule),
|
path: 'home',
|
||||||
data: { showBreadcrumbs: false },
|
loadChildren: () => import('./home-page/home-page.module')
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
.then((m) => m.HomePageModule),
|
||||||
},
|
data: { showBreadcrumbs: false },
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'community-list',
|
},
|
||||||
loadChildren: () => import('./community-list-page/community-list-page.module')
|
{
|
||||||
.then((m) => m.CommunityListPageModule),
|
path: 'community-list',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./community-list-page/community-list-page.module')
|
||||||
},
|
.then((m) => m.CommunityListPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'id',
|
},
|
||||||
loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
|
{
|
||||||
.then((m) => m.LookupIdModule),
|
path: 'id',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
|
||||||
},
|
.then((m) => m.LookupIdModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'handle',
|
},
|
||||||
loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
|
{
|
||||||
.then((m) => m.LookupIdModule),
|
path: 'handle',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
|
||||||
},
|
.then((m) => m.LookupIdModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: REGISTER_PATH,
|
},
|
||||||
loadChildren: () => import('./register-page/register-page.module')
|
{
|
||||||
.then((m) => m.RegisterPageModule),
|
path: REGISTER_PATH,
|
||||||
canActivate: [ServerCheckGuard, SiteRegisterGuard]
|
loadChildren: () => import('./register-page/register-page.module')
|
||||||
},
|
.then((m) => m.RegisterPageModule),
|
||||||
{
|
canActivate: [SiteRegisterGuard]
|
||||||
path: FORGOT_PASSWORD_PATH,
|
},
|
||||||
loadChildren: () => import('./forgot-password/forgot-password.module')
|
{
|
||||||
.then((m) => m.ForgotPasswordModule),
|
path: FORGOT_PASSWORD_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./forgot-password/forgot-password.module')
|
||||||
},
|
.then((m) => m.ForgotPasswordModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: COMMUNITY_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./community-page/community-page.module')
|
{
|
||||||
.then((m) => m.CommunityPageModule),
|
path: COMMUNITY_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./community-page/community-page.module')
|
||||||
},
|
.then((m) => m.CommunityPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: COLLECTION_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./collection-page/collection-page.module')
|
{
|
||||||
.then((m) => m.CollectionPageModule),
|
path: COLLECTION_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./collection-page/collection-page.module')
|
||||||
},
|
.then((m) => m.CollectionPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: ITEM_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./item-page/item-page.module')
|
{
|
||||||
.then((m) => m.ItemPageModule),
|
path: ITEM_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./item-page/item-page.module')
|
||||||
},
|
.then((m) => m.ItemPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'entities/:entity-type',
|
},
|
||||||
loadChildren: () => import('./item-page/item-page.module')
|
{
|
||||||
.then((m) => m.ItemPageModule),
|
path: 'entities/:entity-type',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./item-page/item-page.module')
|
||||||
},
|
.then((m) => m.ItemPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: LEGACY_BITSTREAM_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./bitstream-page/bitstream-page.module')
|
{
|
||||||
.then((m) => m.BitstreamPageModule),
|
path: LEGACY_BITSTREAM_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./bitstream-page/bitstream-page.module')
|
||||||
},
|
.then((m) => m.BitstreamPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: BITSTREAM_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./bitstream-page/bitstream-page.module')
|
{
|
||||||
.then((m) => m.BitstreamPageModule),
|
path: BITSTREAM_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./bitstream-page/bitstream-page.module')
|
||||||
},
|
.then((m) => m.BitstreamPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'mydspace',
|
},
|
||||||
loadChildren: () => import('./my-dspace-page/my-dspace-page.module')
|
{
|
||||||
.then((m) => m.MyDSpacePageModule),
|
path: 'mydspace',
|
||||||
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./my-dspace-page/my-dspace-page.module')
|
||||||
},
|
.then((m) => m.MyDSpacePageModule),
|
||||||
{
|
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
||||||
path: 'search',
|
},
|
||||||
loadChildren: () => import('./search-page/search-page-routing.module')
|
{
|
||||||
.then((m) => m.SearchPageRoutingModule),
|
path: 'search',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./search-page/search-page-routing.module')
|
||||||
},
|
.then((m) => m.SearchPageRoutingModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'browse',
|
},
|
||||||
loadChildren: () => import('./browse-by/browse-by-page.module')
|
{
|
||||||
.then((m) => m.BrowseByPageModule),
|
path: 'browse',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./browse-by/browse-by-page.module')
|
||||||
},
|
.then((m) => m.BrowseByPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: ADMIN_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./admin/admin.module')
|
{
|
||||||
.then((m) => m.AdminModule),
|
path: ADMIN_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, SiteAdministratorGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./admin/admin.module')
|
||||||
},
|
.then((m) => m.AdminModule),
|
||||||
{
|
canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard]
|
||||||
path: 'login',
|
},
|
||||||
loadChildren: () => import('./login-page/login-page.module')
|
{
|
||||||
.then((m) => m.LoginPageModule),
|
path: 'login',
|
||||||
canActivate: [ServerCheckGuard]
|
loadChildren: () => import('./login-page/login-page.module')
|
||||||
},
|
.then((m) => m.LoginPageModule),
|
||||||
{
|
canActivate: [ServerCheckGuard]
|
||||||
path: 'logout',
|
},
|
||||||
loadChildren: () => import('./logout-page/logout-page.module')
|
{
|
||||||
.then((m) => m.LogoutPageModule),
|
path: 'logout',
|
||||||
canActivate: [ServerCheckGuard]
|
loadChildren: () => import('./logout-page/logout-page.module')
|
||||||
},
|
.then((m) => m.LogoutPageModule),
|
||||||
{
|
canActivate: [ServerCheckGuard]
|
||||||
path: 'submit',
|
},
|
||||||
loadChildren: () => import('./submit-page/submit-page.module')
|
{
|
||||||
.then((m) => m.SubmitPageModule),
|
path: 'submit',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./submit-page/submit-page.module')
|
||||||
},
|
.then((m) => m.SubmitPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'import-external',
|
},
|
||||||
loadChildren: () => import('./import-external-page/import-external-page.module')
|
{
|
||||||
.then((m) => m.ImportExternalPageModule),
|
path: 'import-external',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./import-external-page/import-external-page.module')
|
||||||
},
|
.then((m) => m.ImportExternalPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: 'workspaceitems',
|
},
|
||||||
loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page.module')
|
{
|
||||||
.then((m) => m.WorkspaceitemsEditPageModule),
|
path: 'workspaceitems',
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page.module')
|
||||||
},
|
.then((m) => m.WorkspaceitemsEditPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: WORKFLOW_ITEM_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module')
|
{
|
||||||
.then((m) => m.WorkflowItemsEditPageModule),
|
path: WORKFLOW_ITEM_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module')
|
||||||
},
|
.then((m) => m.WorkflowItemsEditPageModule),
|
||||||
{
|
canActivate: [EndUserAgreementCurrentUserGuard]
|
||||||
path: PROFILE_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./profile-page/profile-page.module')
|
{
|
||||||
.then((m) => m.ProfilePageModule),
|
path: PROFILE_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./profile-page/profile-page.module')
|
||||||
},
|
.then((m) => m.ProfilePageModule),
|
||||||
{
|
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
||||||
path: PROCESS_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./process-page/process-page.module')
|
{
|
||||||
.then((m) => m.ProcessPageModule),
|
path: PROCESS_MODULE_PATH,
|
||||||
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
loadChildren: () => import('./process-page/process-page.module')
|
||||||
},
|
.then((m) => m.ProcessPageModule),
|
||||||
{
|
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
||||||
path: INFO_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./info/info.module').then((m) => m.InfoModule),
|
{
|
||||||
canActivate: [ServerCheckGuard]
|
path: INFO_MODULE_PATH,
|
||||||
},
|
loadChildren: () => import('./info/info.module').then((m) => m.InfoModule),
|
||||||
{
|
canActivate: [ServerCheckGuard]
|
||||||
path: REQUEST_COPY_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./request-copy/request-copy.module').then((m) => m.RequestCopyModule),
|
{
|
||||||
canActivate: [ServerCheckGuard, AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
path: REQUEST_COPY_MODULE_PATH,
|
||||||
},
|
loadChildren: () => import('./request-copy/request-copy.module').then((m) => m.RequestCopyModule),
|
||||||
{
|
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
|
||||||
path: FORBIDDEN_PATH,
|
},
|
||||||
component: ThemedForbiddenComponent
|
{
|
||||||
},
|
path: FORBIDDEN_PATH,
|
||||||
{
|
component: ThemedForbiddenComponent
|
||||||
path: 'statistics',
|
},
|
||||||
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
|
{
|
||||||
.then((m) => m.StatisticsPageRoutingModule),
|
path: 'statistics',
|
||||||
canActivate: [ServerCheckGuard]
|
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
|
||||||
},
|
.then((m) => m.StatisticsPageRoutingModule),
|
||||||
{
|
canActivate: [ServerCheckGuard]
|
||||||
path: ACCESS_CONTROL_MODULE_PATH,
|
},
|
||||||
loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule),
|
{
|
||||||
canActivate: [ServerCheckGuard, GroupAdministratorGuard],
|
path: ACCESS_CONTROL_MODULE_PATH,
|
||||||
},
|
loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule),
|
||||||
{ path: '500', component: ThemedPageInternalServerErrorComponent },
|
canActivate: [GroupAdministratorGuard],
|
||||||
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
|
},
|
||||||
]
|
|
||||||
}
|
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
|
||||||
|
]
|
||||||
|
}
|
||||||
], {
|
], {
|
||||||
onSameUrlNavigation: 'reload',
|
onSameUrlNavigation: 'reload',
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user