import { SortMeta } from 'primeng/api'
import { buildVideoLink, buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
import { environment } from 'src/environments/environment'
-import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core'
+import { Component, Input, OnInit, ViewChild } from '@angular/core'
import { DomSanitizer } from '@angular/platform-browser'
import { ActivatedRoute, Router } from '@angular/router'
import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core'
import { AbuseService, BlocklistService, VideoBlockService } from '@app/shared/shared-moderation'
import { VideoCommentService } from '@app/shared/shared-video-comment'
import { AbuseState, AdminAbuse } from '@shared/models'
+import { AdvancedInputFilter } from '../shared-forms'
import { AbuseMessageModalComponent } from './abuse-message-modal.component'
import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
import { ProcessedAbuse } from './processed-abuse.model'
-import { AdvancedInputFilter } from '../shared-forms'
const logger = debug('peertube:moderation:AbuseListTableComponent')
templateUrl: './abuse-list-table.component.html',
styleUrls: [ '../shared-moderation/moderation.scss', './abuse-list-table.component.scss' ]
})
-export class AbuseListTableComponent extends RestTable implements OnInit, AfterViewInit {
+export class AbuseListTableComponent extends RestTable implements OnInit {
@Input() viewType: 'admin' | 'user'
@ViewChild('abuseMessagesModal', { static: true }) abuseMessagesModal: AbuseMessageModalComponent
]
this.initialize()
- this.listenToSearchChange()
- }
-
- ngAfterViewInit () {
- if (this.search) this.setTableFilter(this.search, false)
}
isAdminView () {
}
onModerationCommentUpdated () {
- this.loadData()
+ this.reloadData()
}
isAbuseAccepted (abuse: AdminAbuse) {
}
getAccountUrl (abuse: ProcessedAbuse) {
- return '/accounts/' + abuse.flaggedAccount.nameWithHost
+ return '/a/' + abuse.flaggedAccount.nameWithHost
}
getVideoEmbed (abuse: AdminAbuse) {
this.abuseService.removeAbuse(abuse).subscribe(
() => {
this.notifier.success($localize`Abuse deleted.`)
- this.loadData()
+ this.reloadData()
},
err => this.notifier.error(err.message)
updateAbuseState (abuse: AdminAbuse, state: AbuseState) {
this.abuseService.updateAbuse(abuse, { state })
.subscribe(
- () => this.loadData(),
+ () => this.reloadData(),
err => this.notifier.error(err.message)
)
return Actor.IS_LOCAL(abuse.reporterAccount.host)
}
- protected loadData () {
+ protected reloadData () {
logger('Loading data.')
const options = {