rename blacklist to block/blocklist, merge block and auto-block views
[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 { VideoBlockListComponent } from '@app/+admin/moderation/video-block-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-abuses/list',
26         component: VideoAbuseListComponent,
27         canActivate: [ UserRightGuard ],
28         data: {
29           userRight: UserRight.MANAGE_VIDEO_ABUSES,
30           meta: {
31             title: 'Video reports'
32           }
33         }
34       },
35       {
36         path: 'video-blacklist',
37         redirectTo: 'video-blocks/list',
38         pathMatch: 'full'
39       },
40       {
41         path: 'video-auto-blacklist',
42         redirectTo: 'video-blocks/list',
43         pathMatch: 'full'
44       },
45       {
46         path: 'video-auto-blacklist/list',
47         redirectTo: 'video-blocks/list',
48         pathMatch: 'full'
49       },
50       {
51         path: 'video-blacklist',
52         redirectTo: 'video-blocks/list',
53         pathMatch: 'full'
54       },
55       {
56         path: 'video-blocks/list',
57         component: VideoBlockListComponent,
58         canActivate: [ UserRightGuard ],
59         data: {
60           userRight: UserRight.MANAGE_VIDEO_BLOCKS,
61           meta: {
62             title: 'Videos blocked'
63           }
64         }
65       },
66       {
67         path: 'blocklist/accounts',
68         component: InstanceAccountBlocklistComponent,
69         canActivate: [ UserRightGuard ],
70         data: {
71           userRight: UserRight.MANAGE_ACCOUNTS_BLOCKLIST,
72           meta: {
73             title: 'Muted accounts'
74           }
75         }
76       },
77       {
78         path: 'blocklist/servers',
79         component: InstanceServerBlocklistComponent,
80         canActivate: [ UserRightGuard ],
81         data: {
82           userRight: UserRight.MANAGE_SERVERS_BLOCKLIST,
83           meta: {
84             title: 'Muted instances'
85           }
86         }
87       }
88     ]
89   }
90 ]