]>
Commit | Line | Data |
---|---|---|
1 | import { Routes } from '@angular/router' | |
2 | ||
3 | import { UserRightGuard } from '../../core' | |
4 | import { UserRight } from '../../../../../shared' | |
5 | import { UsersComponent } from './users.component' | |
6 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' | |
7 | import { UserListComponent } from './user-list' | |
8 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' | |
9 | ||
10 | export const UsersRoutes: Routes = [ | |
11 | { | |
12 | path: 'users', | |
13 | component: UsersComponent, | |
14 | canActivate: [ UserRightGuard ], | |
15 | data: { | |
16 | userRight: UserRight.MANAGE_USERS | |
17 | }, | |
18 | children: [ | |
19 | { | |
20 | path: '', | |
21 | redirectTo: 'list', | |
22 | pathMatch: 'full' | |
23 | }, | |
24 | { | |
25 | path: 'list', | |
26 | component: UserListComponent, | |
27 | data: { | |
28 | meta: { | |
29 | title: 'Users list' | |
30 | } | |
31 | } | |
32 | }, | |
33 | { | |
34 | path: 'create', | |
35 | component: UserCreateComponent, | |
36 | data: { | |
37 | meta: { | |
38 | title: 'Create a user' | |
39 | } | |
40 | }, | |
41 | resolve: { | |
42 | serverConfig: ServerConfigResolver | |
43 | } | |
44 | }, | |
45 | { | |
46 | path: 'update/:id', | |
47 | component: UserUpdateComponent, | |
48 | data: { | |
49 | meta: { | |
50 | title: 'Update a user' | |
51 | } | |
52 | } | |
53 | } | |
54 | ] | |
55 | } | |
56 | ] |