forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathapp-routes.ts
More file actions
321 lines (319 loc) · 12.6 KB
/
Copy pathapp-routes.ts
File metadata and controls
321 lines (319 loc) · 12.6 KB
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
import {
InMemoryScrollingOptions,
Route,
RouterConfigOptions,
} from '@angular/router';
import { authBlockingGuard } from '@dspace/core/auth/auth-blocking.guard';
import { authenticatedGuard } from '@dspace/core/auth/authenticated.guard';
import { groupAdministratorGuard } from '@dspace/core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
import { siteAdministratorGuard } from '@dspace/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
import { siteRegisterGuard } from '@dspace/core/data/feature-authorization/feature-authorization-guard/site-register.guard';
import { endUserAgreementCurrentUserGuard } from '@dspace/core/end-user-agreement/end-user-agreement-current-user.guard';
import { reloadGuard } from '@dspace/core/reload/reload.guard';
import { forgotPasswordCheckGuard } from '@dspace/core/rest-property/forgot-password-check-guard.guard';
import {
BITSTREAM_MODULE_PATH,
COLLECTION_MODULE_PATH,
COMMUNITY_MODULE_PATH,
ERROR_PAGE,
FORBIDDEN_PATH,
INTERNAL_SERVER_ERROR,
ITEM_MODULE_PATH,
LEGACY_BITSTREAM_MODULE_PATH,
} from '@dspace/core/router/core-routing-paths';
import { INFO_MODULE_PATH } from '@dspace/core/router/info-routing-paths';
import { ServerCheckGuard } from '@dspace/core/server-check/server-check.guard';
import { ACCESS_CONTROL_MODULE_PATH } from './access-control/access-control-routing-paths';
import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths';
import {
ADMIN_MODULE_PATH,
BULK_IMPORT_PATH,
EDIT_ITEM_PATH,
FORGOT_PASSWORD_PATH,
HEALTH_PAGE_PATH,
PROFILE_MODULE_PATH,
REGISTER_PATH,
REQUEST_COPY_MODULE_PATH,
WORKFLOW_ITEM_MODULE_PATH,
} from './app-routing-paths';
import { notAuthenticatedGuard } from './core/auth/not-authenticated.guard';
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
import { homePageResolver } from './home-page/home-page.resolver';
import { provideSuggestionNotificationsState } from './notifications/provide-suggestion-notifications-state';
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component';
import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths';
import { viewTrackerResolver } from './statistics/angulartics/dspace/view-tracker.resolver';
import { provideSubmissionState } from './submission/provide-submission-state';
import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths';
export const APP_ROUTES: Route[] = [
{ path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent, data: { title: '500.page-internal-server-error' } },
{ path: ERROR_PAGE, component: ThemedPageErrorComponent },
{
path: '',
canActivate: [authBlockingGuard],
canActivateChild: [ServerCheckGuard],
children: [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{
path: 'reload/:rnd',
component: ThemedPageNotFoundComponent,
pathMatch: 'full',
canActivate: [reloadGuard],
},
{
path: 'home',
loadChildren: () => import('./home-page/home-page-routes')
.then((m) => m.ROUTES),
data: {
showBreadcrumbs: false,
enableRSS: true,
dsoPath: 'site',
},
providers: [provideSuggestionNotificationsState()],
canActivate: [endUserAgreementCurrentUserGuard],
resolve: {
site: homePageResolver,
tracking: viewTrackerResolver,
},
},
{
path: 'community-list',
loadChildren: () => import('./community-list-page/community-list-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'id',
loadChildren: () => import('./lookup-by-id/lookup-by-id-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'handle',
loadChildren: () => import('./lookup-by-id/lookup-by-id-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: REGISTER_PATH,
loadChildren: () => import('./register-page/register-page-routes')
.then((m) => m.ROUTES),
canActivate: [notAuthenticatedGuard, siteRegisterGuard],
},
{
path: FORGOT_PASSWORD_PATH,
loadChildren: () => import('./forgot-password/forgot-password-routes')
.then((m) => m.ROUTES),
canActivate: [notAuthenticatedGuard, endUserAgreementCurrentUserGuard, forgotPasswordCheckGuard],
},
{
path: COMMUNITY_MODULE_PATH,
loadChildren: () => import('./community-page/community-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: COLLECTION_MODULE_PATH,
loadChildren: () => import('./collection-page/collection-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: ITEM_MODULE_PATH,
loadChildren: () => import('./item-page/item-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'entities/:entity-type',
loadChildren: () => import('./item-page/item-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: LEGACY_BITSTREAM_MODULE_PATH,
loadChildren: () => import('./bitstream-page/bitstream-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: BITSTREAM_MODULE_PATH,
loadChildren: () => import('./bitstream-page/bitstream-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'mydspace',
loadChildren: () => import('./my-dspace-page/my-dspace-page-routes')
.then((m) => m.ROUTES),
data: { enableRSS: true },
providers: [provideSuggestionNotificationsState()],
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: 'search',
loadChildren: () => import('./search-page/search-page-routes')
.then((m) => m.ROUTES),
data: { enableRSS: true },
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'browse',
loadChildren: () => import('./browse-by/browse-by-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: ADMIN_MODULE_PATH,
loadChildren: () => import('./admin/admin-routes')
.then((m) => m.ROUTES),
data: { enableRSS: true },
canActivate: [siteAdministratorGuard, endUserAgreementCurrentUserGuard],
},
{
path: NOTIFICATIONS_MODULE_PATH,
loadChildren: () => import('./quality-assurance-notifications-pages/notifications-pages-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: 'login',
loadChildren: () => import('./login-page/login-page-routes')
.then((m) => m.ROUTES),
canActivate: [notAuthenticatedGuard],
},
{
path: 'logout',
loadChildren: () => import('./logout-page/logout-page-routes')
.then((m) => m.ROUTES),
canActivate: [authenticatedGuard],
},
{
path: 'submit',
loadChildren: () => import('./submit-page/submit-page-routes')
.then((m) => m.ROUTES),
providers: [provideSubmissionState()],
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'import-external',
loadChildren: () => import('./import-external-page/import-external-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'workspaceitems',
loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page-routes')
.then((m) => m.ROUTES),
providers: [provideSubmissionState()],
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: WORKFLOW_ITEM_MODULE_PATH,
providers: [provideSubmissionState()],
loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page-routes')
.then((m) => m.ROUTES),
data: { enableRSS: true },
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: PROFILE_MODULE_PATH,
loadChildren: () => import('./profile-page/profile-page-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: PROCESS_MODULE_PATH,
loadChildren: () => import('./process-page/process-page-routes')
.then((m) => m.ROUTES),
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: SUGGESTION_MODULE_PATH,
loadChildren: () => import('./suggestions-page/suggestions-page-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: INFO_MODULE_PATH,
loadChildren: () => import('./info/info-routes').then((m) => m.ROUTES),
},
{
path: REQUEST_COPY_MODULE_PATH,
loadChildren: () => import('./request-copy/request-copy-routes').then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: FORBIDDEN_PATH,
component: ThemedForbiddenComponent,
data: { title: '403.forbidden' },
},
{
path: 'statistics',
loadChildren: () => import('./statistics-page/statistics-page-routes')
.then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: HEALTH_PAGE_PATH,
loadChildren: () => import('./health-page/health-page-routes')
.then((m) => m.ROUTES),
},
{
path: ACCESS_CONTROL_MODULE_PATH,
loadChildren: () => import('./access-control/access-control-routes').then((m) => m.ROUTES),
canActivate: [groupAdministratorGuard, endUserAgreementCurrentUserGuard],
},
{
path: 'auditlogs',
loadChildren: () => import('./audit-page/audit-page-routes').then((m) => m.ROUTES),
canActivate: [siteAdministratorGuard, endUserAgreementCurrentUserGuard],
},
{
path: BULK_IMPORT_PATH,
loadChildren: () => import('./bulk-import/bulk-import-page-routes').then((m) => m.ROUTES),
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: 'subscriptions',
loadChildren: () => import('./subscriptions-page/subscriptions-page-routes')
.then((m) => m.ROUTES),
canActivate: [authenticatedGuard],
},
{
path: EDIT_ITEM_PATH,
loadChildren: () => import('./edit-item/edit-item-routes').then((m) => m.ROUTES),
canActivate: [endUserAgreementCurrentUserGuard],
},
{
path: 'external-login/:token',
loadChildren: () => import('./external-login-page/external-login-routes').then((m) => m.ROUTES),
canActivate: [notAuthenticatedGuard],
},
{
path: 'review-account/:token',
loadChildren: () => import('./external-login-review-account-info-page/external-login-review-account-info-page-routes')
.then((m) => m.ROUTES),
},
{
path: 'email-confirmation',
loadChildren: () => import('./external-login-email-confirmation-page/external-login-email-confirmation-page-routes')
.then((m) => m.ROUTES),
canActivate: [notAuthenticatedGuard],
},
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent, data: { title: '404.page-not-found' } },
],
},
];
export const APP_ROUTING_CONF: RouterConfigOptions = {
onSameUrlNavigation: 'reload',
};
export const APP_ROUTING_SCROLL_CONF: InMemoryScrollingOptions = {
scrollPositionRestoration: 'top',
anchorScrolling: 'enabled',
};