Merge branch 'release/v1.2.0'
[oweals/peertube.git] / client / src / app / +admin / moderation / moderation.routes.ts
1 import { Routes } from '@angular/router'
2 import { UserRight } from '../../../../../shared'
3 import { UserRightGuard } from '@app/core'
4 import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list'
5 import { VideoBlacklistListComponent } from '@app/+admin/moderation/video-blacklist-list'
6 import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
7 import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
8
9 export const ModerationRoutes: Routes = [
10   {
11     path: 'moderation',
12     component: ModerationComponent,
13     children: [
14       {
15         path: '',
16         redirectTo: 'video-abuses/list',
17         pathMatch: 'full'
18       },
19       {
20         path: 'video-abuses',
21         redirectTo: 'video-abuses/list',
22         pathMatch: 'full'
23       },
24       {
25         path: 'video-blacklist',
26         redirectTo: 'video-blacklist/list',
27         pathMatch: 'full'
28       },
29       {
30         path: 'video-abuses/list',
31         component: VideoAbuseListComponent,
32         canActivate: [ UserRightGuard ],
33         data: {
34           userRight: UserRight.MANAGE_VIDEO_ABUSES,
35           meta: {
36             title: 'Video abuses list'
37           }
38         }
39       },
40       {
41         path: 'video-blacklist/list',
42         component: VideoBlacklistListComponent,
43         canActivate: [ UserRightGuard ],
44         data: {
45           userRight: UserRight.MANAGE_VIDEO_BLACKLIST,
46           meta: {
47             title: 'Blacklisted videos'
48           }
49         }
50       },
51       {
52         path: 'blocklist/accounts',
53         component: InstanceAccountBlocklistComponent,
54         canActivate: [ UserRightGuard ],
55         data: {
56           userRight: UserRight.MANAGE_ACCOUNTS_BLOCKLIST,
57           meta: {
58             title: 'Muted accounts'
59           }
60         }
61       },
62       {
63         path: 'blocklist/servers',
64         component: InstanceServerBlocklistComponent,
65         canActivate: [ UserRightGuard ],
66         data: {
67           userRight: UserRight.MANAGE_SERVERS_BLOCKLIST,
68           meta: {
69             title: 'Muted instances'
70           }
71         }
72       }
73     ]
74   }
75 ]