feat(plugins): add doAction admin-abuse-list:load-data
This commit is contained in:
parent
1d84c9b45e
commit
344672dba8
|
@ -115,6 +115,8 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
await this.pluginService.ensurePluginsAreLoaded('admin-comments')
|
await this.pluginService.ensurePluginsAreLoaded('admin-comments')
|
||||||
|
this.pluginService.addAction('admin-abuse-list:load-data', this.reloadDataInternal.bind(this))
|
||||||
|
|
||||||
const abuseActions: DropdownAction<ProcessedAbuse>[][] = [] = [
|
const abuseActions: DropdownAction<ProcessedAbuse>[][] = [] = [
|
||||||
this.buildInternalActions(),
|
this.buildInternalActions(),
|
||||||
|
|
||||||
|
@ -240,7 +242,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
|
||||||
? this.abuseService.getAdminAbuses(options)
|
? this.abuseService.getAdminAbuses(options)
|
||||||
: this.abuseService.getUserAbuses(options)
|
: this.abuseService.getUserAbuses(options)
|
||||||
|
|
||||||
return observable.subscribe({
|
observable.subscribe({
|
||||||
next: async resultList => {
|
next: async resultList => {
|
||||||
this.totalRecords = resultList.total
|
this.totalRecords = resultList.total
|
||||||
|
|
||||||
|
@ -285,6 +287,8 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
|
||||||
|
|
||||||
error: err => this.notifier.error(err.message)
|
error: err => this.notifier.error(err.message)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return observable
|
||||||
}
|
}
|
||||||
|
|
||||||
private buildInternalActions (): DropdownAction<ProcessedAbuse>[] {
|
private buildInternalActions (): DropdownAction<ProcessedAbuse>[] {
|
||||||
|
|
|
@ -212,6 +212,7 @@ export interface ClientHook {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const clientDoActionObject = {
|
export const clientDoActionObject = {
|
||||||
|
'admin-abuse-list:load-data': true,
|
||||||
'application:increment-loader': true,
|
'application:increment-loader': true,
|
||||||
'application:decrement-loader': true,
|
'application:decrement-loader': true,
|
||||||
'admin-user-list:load-data': true,
|
'admin-user-list:load-data': true,
|
||||||
|
|
Loading…
Reference in New Issue