Move admin comments list in overviews menu

This commit is contained in:
Chocobozzz 2022-02-28 16:27:25 +01:00
parent f1c70a8666
commit 5a51ecc217
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
13 changed files with 935 additions and 907 deletions

View File

@ -52,6 +52,14 @@ export class AdminComponent implements OnInit {
})
}
if (this.hasVideoCommentsRight()) {
overviewItems.children.push({
label: $localize`Comments`,
routerLink: '/admin/comments',
iconName: 'message-circle'
})
}
if (overviewItems.children.length !== 0) {
this.menuEntries.push(overviewItems)
}
@ -104,14 +112,6 @@ export class AdminComponent implements OnInit {
})
}
if (this.hasVideoCommentsRight()) {
moderationItems.children.push({
label: $localize`Video comments`,
routerLink: '/admin/moderation/video-comments/list',
iconName: 'message-circle'
})
}
if (this.hasAccountsBlocklistRight()) {
moderationItems.children.push({
label: $localize`Muted accounts`,

View File

@ -32,13 +32,13 @@ import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbo
import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component'
import { AbuseListComponent, VideoBlockListComponent } from './moderation'
import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist'
import { VideoCommentListComponent } from './moderation/video-comment-list'
import {
UserCreateComponent,
UserListComponent,
UserPasswordComponent,
UserUpdateComponent,
VideoAdminService,
VideoCommentListComponent,
VideoListComponent
} from './overview'
import {

View File

@ -2,7 +2,6 @@ import { Routes } from '@angular/router'
import { AbuseListComponent } from '@app/+admin/moderation/abuse-list'
import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list'
import { VideoCommentListComponent } from './video-comment-list'
import { UserRightGuard } from '@app/core'
import { UserRight } from '@shared/models'
@ -69,6 +68,7 @@ export const ModerationRoutes: Routes = [
}
},
// We move this component in admin overview pages
{
path: 'video-comments',
redirectTo: 'video-comments/list',
@ -76,14 +76,8 @@ export const ModerationRoutes: Routes = [
},
{
path: 'video-comments/list',
component: VideoCommentListComponent,
canActivate: [ UserRightGuard ],
data: {
userRight: UserRight.SEE_ALL_COMMENTS,
meta: {
title: $localize`Video comments`
}
}
redirectTo: '/admin/comments/list',
pathMatch: 'full'
},
{

View File

@ -1 +1,2 @@
export * from './video-comment-list.component'
export * from './video-comment.routes'

View File

@ -0,0 +1,30 @@
import { Routes } from '@angular/router'
import { UserRightGuard } from '@app/core'
import { UserRight } from '@shared/models'
import { VideoCommentListComponent } from './video-comment-list.component'
export const commentRoutes: Routes = [
{
path: 'comments',
canActivate: [ UserRightGuard ],
data: {
userRight: UserRight.SEE_ALL_COMMENTS
},
children: [
{
path: '',
redirectTo: 'list',
pathMatch: 'full'
},
{
path: 'list',
component: VideoCommentListComponent,
data: {
meta: {
title: $localize`Comments list`
}
}
}
]
}
]

View File

@ -1,3 +1,4 @@
export * from './comments'
export * from './users'
export * from './videos'
export * from './overview.routes'

View File

@ -1,8 +1,10 @@
import { Routes } from '@angular/router'
import { UsersRoutes } from './users'
import { VideosRoutes } from './videos'
import { commentRoutes } from './comments'
import { usersRoutes } from './users'
import { videosRoutes } from './videos'
export const OverviewRoutes: Routes = [
...UsersRoutes,
...VideosRoutes
...commentRoutes,
...usersRoutes,
...videosRoutes
]

View File

@ -4,7 +4,7 @@ import { UserRight } from '@shared/models'
import { UserCreateComponent, UserUpdateComponent } from './user-edit'
import { UserListComponent } from './user-list'
export const UsersRoutes: Routes = [
export const usersRoutes: Routes = [
{
path: 'users',
canActivate: [ UserRightGuard ],

View File

@ -3,7 +3,7 @@ import { UserRightGuard } from '@app/core'
import { UserRight } from '@shared/models'
import { VideoListComponent } from './video-list.component'
export const VideosRoutes: Routes = [
export const videosRoutes: Routes = [
{
path: 'videos',
canActivate: [ UserRightGuard ],

File diff suppressed because one or more lines are too long