forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp-routing.module.ts
290 lines (287 loc) · 11.8 KB
/
app-routing.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
import { NgModule } from '@angular/core';
import { RouterModule, NoPreloading } from '@angular/router';
import { AuthBlockingGuard } from './core/auth/auth-blocking.guard';
import { AuthenticatedGuard } from './core/auth/authenticated.guard';
import {
SiteAdministratorGuard
} from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
import {
ACCESS_CONTROL_MODULE_PATH,
ADMIN_MODULE_PATH,
BITSTREAM_MODULE_PATH,
ERROR_PAGE,
FORBIDDEN_PATH,
FORGOT_PASSWORD_PATH,
HEALTH_PAGE_PATH,
INFO_MODULE_PATH,
INTERNAL_SERVER_ERROR,
LEGACY_BITSTREAM_MODULE_PATH,
LICENSES_MODULE_PATH,
PROFILE_MODULE_PATH,
REGISTER_PATH,
REQUEST_COPY_MODULE_PATH,
CONTRACT_PAGE_MODULE_PATH,
WORKFLOW_ITEM_MODULE_PATH,
} from './app-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 { ITEM_MODULE_PATH } from './item-page/item-page-routing-paths';
import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths';
import { ReloadGuard } from './core/reload/reload.guard';
import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-user-agreement-current-user.guard';
import { SiteRegisterGuard } from './core/data/feature-authorization/feature-authorization-guard/site-register.guard';
import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component';
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
import {
GroupAdministratorGuard
} from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
import {
ThemedPageInternalServerErrorComponent
} from './page-internal-server-error/themed-page-internal-server-error.component';
import { ServerCheckGuard } from './core/server-check/server-check.guard';
import { MenuResolver } from './menu.resolver';
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';
import { HANDLE_TABLE_MODULE_PATH } from './handle-page/handle-page-routing-paths';
import { STATIC_PAGE_PATH } from './static-page/static-page-routing-paths';
@NgModule({
imports: [
RouterModule.forRoot([
{ path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent },
{ path: ERROR_PAGE , component: ThemedPageErrorComponent },
{
path: '',
canActivate: [AuthBlockingGuard],
canActivateChild: [ServerCheckGuard],
resolve: [MenuResolver],
children: [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{
path: 'reload/:rnd',
component: ThemedPageNotFoundComponent,
pathMatch: 'full',
canActivate: [ReloadGuard]
},
{
path: 'home',
loadChildren: () => import('./home-page/home-page.module')
.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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: 'id',
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: REGISTER_PATH,
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: COMMUNITY_MODULE_PATH,
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: ITEM_MODULE_PATH,
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: LEGACY_BITSTREAM_MODULE_PATH,
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: 'mydspace',
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: 'browse',
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),
canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard]
},
{
path: 'contact',
loadChildren: () => import('./contact-page/contact-page.module')
.then((m) => m.ContactPageModule)
},
{
path: 'login',
loadChildren: () => import('./login-page/login-page.module')
.then((m) => m.LoginPageModule)
},
{
path: 'logout',
loadChildren: () => import('./logout-page/logout-page.module')
.then((m) => m.LogoutPageModule)
},
{
path: 'submit',
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: 'workspaceitems',
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),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: PROFILE_MODULE_PATH,
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),
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
},
{
path: INFO_MODULE_PATH,
loadChildren: () => import('./info/info.module').then((m) => m.InfoModule)
},
{
path: REQUEST_COPY_MODULE_PATH,
loadChildren: () => import('./request-copy/request-copy.module').then((m) => m.RequestCopyModule),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: FORBIDDEN_PATH,
component: ThemedForbiddenComponent
},
{
path: 'statistics',
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
.then((m) => m.StatisticsPageRoutingModule),
canActivate: [EndUserAgreementCurrentUserGuard],
},
{
path: HEALTH_PAGE_PATH,
loadChildren: () => import('./health-page/health-page.module')
.then((m) => m.HealthPageModule)
},
{
path: ACCESS_CONTROL_MODULE_PATH,
loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule),
canActivate: [GroupAdministratorGuard, EndUserAgreementCurrentUserGuard],
},
{
path: 'subscriptions',
loadChildren: () => import('./subscriptions-page/subscriptions-page-routing.module')
.then((m) => m.SubscriptionsPageRoutingModule),
canActivate: [AuthenticatedGuard]
},
{
path: LICENSES_MODULE_PATH,
loadChildren: () => import('./clarin-licenses/clarin-license.module').then((m) => m.ClarinLicenseModule),
},
{
path: CONTRACT_PAGE_MODULE_PATH,
loadChildren: () => import('./license-contract-page/license-contract-page.module')
.then((m) => m.LicenseContractPageModule),
canActivate: [EndUserAgreementCurrentUserGuard]
},
{
path: HANDLE_TABLE_MODULE_PATH,
loadChildren: () => import('./handle-page/handle-page.module').then((m) => m.HandlePageModule),
canActivate: [SiteAdministratorGuard],
},
{
path: STATIC_PAGE_PATH,
loadChildren: () => import('./static-page/static-page.module').then((m) => m.StaticPageModule),
},
{
path: 'share-submission',
loadChildren: () => import('./share-submission/share-submission.module').then((m) => m.ShareSubmissionModule),
canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard]
},
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent }
]
}
], {
// enableTracing: true,
useHash: false,
scrollPositionRestoration: 'enabled',
anchorScrolling: 'enabled',
initialNavigation: 'enabledBlocking',
preloadingStrategy: NoPreloading,
onSameUrlNavigation: 'reload',
})
],
exports: [RouterModule],
})
export class AppRoutingModule {
}