mirror of https://github.com/Chocobozzz/PeerTube
feat(plugins): add filter:admin-comment-list.actions.create.result
parent
892bb40226
commit
ad6b7371e4
|
@ -1,7 +1,7 @@
|
||||||
import { DatePipe, NgClass, NgIf } from '@angular/common'
|
import { DatePipe, NgClass, NgIf } from '@angular/common'
|
||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnInit } from '@angular/core'
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router'
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router'
|
||||||
import { AuthService, ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core'
|
import { AuthService, ConfirmService, HooksService, MarkdownService, Notifier, PluginService, RestPagination, RestTable } from '@app/core'
|
||||||
import { formatICU } from '@app/helpers'
|
import { formatICU } from '@app/helpers'
|
||||||
import { BulkService } from '@app/shared/shared-moderation/bulk.service'
|
import { BulkService } from '@app/shared/shared-moderation/bulk.service'
|
||||||
import { VideoCommentForAdminOrUser } from '@app/shared/shared-video-comment/video-comment.model'
|
import { VideoCommentForAdminOrUser } from '@app/shared/shared-video-comment/video-comment.model'
|
||||||
|
@ -68,11 +68,18 @@ export class VideoCommentListAdminOwnerComponent extends RestTable <VideoComment
|
||||||
private confirmService: ConfirmService,
|
private confirmService: ConfirmService,
|
||||||
private videoCommentService: VideoCommentService,
|
private videoCommentService: VideoCommentService,
|
||||||
private markdownRenderer: MarkdownService,
|
private markdownRenderer: MarkdownService,
|
||||||
private bulkService: BulkService
|
private bulkService: BulkService,
|
||||||
|
private hooks: HooksService,
|
||||||
|
private pluginService: PluginService
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
this.videoCommentActions = [
|
async ngOnInit () {
|
||||||
|
this.initialize()
|
||||||
|
await this.pluginService.ensurePluginsAreLoaded('admin-comments')
|
||||||
|
|
||||||
|
const videoCommentActions: DropdownAction<VideoCommentForAdminOrUser>[][] = [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
label: $localize`Delete this comment`,
|
label: $localize`Delete this comment`,
|
||||||
|
@ -94,12 +101,9 @@ export class VideoCommentListAdminOwnerComponent extends RestTable <VideoComment
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
this.videoCommentActions = await this.hooks.wrapObject(videoCommentActions, 'admin-comments', 'filter:admin-video-comment-list.actions.create.result')
|
||||||
|
|
||||||
ngOnInit () {
|
const bulkActions: DropdownAction<VideoCommentForAdminOrUser[]>[] = [
|
||||||
this.initialize()
|
|
||||||
|
|
||||||
this.bulkActions = [
|
|
||||||
{
|
{
|
||||||
label: $localize`Delete`,
|
label: $localize`Delete`,
|
||||||
handler: comments => this.removeComments(comments),
|
handler: comments => this.removeComments(comments),
|
||||||
|
|
|
@ -72,7 +72,8 @@ class PluginsManager {
|
||||||
'my-library': new ReplaySubject<boolean>(1),
|
'my-library': new ReplaySubject<boolean>(1),
|
||||||
'video-channel': new ReplaySubject<boolean>(1),
|
'video-channel': new ReplaySubject<boolean>(1),
|
||||||
'my-account': new ReplaySubject<boolean>(1),
|
'my-account': new ReplaySubject<boolean>(1),
|
||||||
'admin-users': new ReplaySubject<boolean>(1)
|
'admin-users': new ReplaySubject<boolean>(1),
|
||||||
|
'admin-comments': new ReplaySubject<boolean>(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly peertubeHelpersFactory: PeertubeHelpersFactory
|
private readonly peertubeHelpersFactory: PeertubeHelpersFactory
|
||||||
|
|
|
@ -102,6 +102,9 @@ export const clientFilterHookObject = {
|
||||||
// Filter bulk actions in user list
|
// Filter bulk actions in user list
|
||||||
'filter:admin-user-list.bulk-actions.create.result': true,
|
'filter:admin-user-list.bulk-actions.create.result': true,
|
||||||
|
|
||||||
|
// Filter actions in comment list
|
||||||
|
'filter:admin-video-comment-list.actions.create.result': true,
|
||||||
|
|
||||||
// Filter user moderation actions
|
// Filter user moderation actions
|
||||||
'filter:admin-user-moderation.actions.create.result': true
|
'filter:admin-user-moderation.actions.create.result': true
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,5 @@ export type PluginClientScope =
|
||||||
'my-library' |
|
'my-library' |
|
||||||
'video-channel' |
|
'video-channel' |
|
||||||
'my-account' |
|
'my-account' |
|
||||||
'admin-users'
|
'admin-users' |
|
||||||
|
'admin-comments'
|
||||||
|
|
Loading…
Reference in New Issue