feat(plugin): add filter:admin-abuse-list.actions.create.result
This commit is contained in:
parent
98c3531a25
commit
8c5c8b7032
|
@ -2,7 +2,7 @@ import debug from 'debug'
|
||||||
import { SortMeta, SharedModule } from 'primeng/api'
|
import { SortMeta, SharedModule } from 'primeng/api'
|
||||||
import { Component, Input, OnInit, ViewChild } from '@angular/core'
|
import { Component, Input, OnInit, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute, Router } from '@angular/router'
|
import { ActivatedRoute, Router } from '@angular/router'
|
||||||
import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core'
|
import { ConfirmService, HooksService, MarkdownService, Notifier, PluginService, RestPagination, RestTable } from '@app/core'
|
||||||
import { AbuseState, AbuseStateType, AdminAbuse } from '@peertube/peertube-models'
|
import { AbuseState, AbuseStateType, AdminAbuse } from '@peertube/peertube-models'
|
||||||
import { logger } from '@root-helpers/logger'
|
import { logger } from '@root-helpers/logger'
|
||||||
import { AbuseMessageModalComponent } from './abuse-message-modal.component'
|
import { AbuseMessageModalComponent } from './abuse-message-modal.component'
|
||||||
|
@ -106,13 +106,16 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
|
||||||
private videoService: VideoService,
|
private videoService: VideoService,
|
||||||
private videoBlocklistService: VideoBlockService,
|
private videoBlocklistService: VideoBlockService,
|
||||||
private confirmService: ConfirmService,
|
private confirmService: ConfirmService,
|
||||||
private markdownRenderer: MarkdownService
|
private markdownRenderer: MarkdownService,
|
||||||
|
private hooks: HooksService,
|
||||||
|
private pluginService: PluginService
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
async ngOnInit () {
|
||||||
this.abuseActions = [
|
await this.pluginService.ensurePluginsAreLoaded('admin-comments')
|
||||||
|
const abuseActions: DropdownAction<ProcessedAbuse>[][] = [] = [
|
||||||
this.buildInternalActions(),
|
this.buildInternalActions(),
|
||||||
|
|
||||||
this.buildFlaggedAccountActions(),
|
this.buildFlaggedAccountActions(),
|
||||||
|
@ -123,6 +126,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
|
||||||
|
|
||||||
this.buildAccountActions()
|
this.buildAccountActions()
|
||||||
]
|
]
|
||||||
|
this.abuseActions = await this.hooks.wrapObject(abuseActions, 'admin-comments', 'filter:admin-abuse-list.actions.create.result')
|
||||||
|
|
||||||
this.initialize()
|
this.initialize()
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,10 @@ export const clientFilterHookObject = {
|
||||||
'filter:admin-comment-list.bulk-actions.create.result': true,
|
'filter:admin-comment-list.bulk-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,
|
||||||
|
|
||||||
|
// Filter actions in abuse list
|
||||||
|
'filter:admin-abuse-list.actions.create.result': true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ClientFilterHookName = keyof typeof clientFilterHookObject
|
export type ClientFilterHookName = keyof typeof clientFilterHookObject
|
||||||
|
|
Loading…
Reference in New Issue