X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-abuse-list%2Fabuse-list-table.component.ts;h=07b9dddba01335b3958322bc7014b3de348959f7;hb=8cbc40b2fe9d36ef0505b9441276ca561342e9e9;hp=f393c0d1e86ff0f550c1e6fbb83b6613fda1d179;hpb=1fd61899eaea245a5844e33e21f04b2562f16e5e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts index f393c0d1e..07b9dddba 100644 --- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts +++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts @@ -3,7 +3,7 @@ import truncate from 'lodash-es/truncate' 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' @@ -11,10 +11,10 @@ import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared 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') @@ -23,7 +23,7 @@ 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 @@ -89,11 +89,6 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV ] this.initialize() - this.listenToSearchChange() - } - - ngAfterViewInit () { - if (this.search) this.setTableFilter(this.search, false) } isAdminView () { @@ -109,7 +104,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV } onModerationCommentUpdated () { - this.loadData() + this.reloadData() } isAbuseAccepted (abuse: AdminAbuse) { @@ -129,7 +124,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV } getAccountUrl (abuse: ProcessedAbuse) { - return '/accounts/' + abuse.flaggedAccount.nameWithHost + return '/a/' + abuse.flaggedAccount.nameWithHost } getVideoEmbed (abuse: AdminAbuse) { @@ -152,7 +147,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV this.abuseService.removeAbuse(abuse).subscribe( () => { this.notifier.success($localize`Abuse deleted.`) - this.loadData() + this.reloadData() }, err => this.notifier.error(err.message) @@ -162,7 +157,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV updateAbuseState (abuse: AdminAbuse, state: AbuseState) { this.abuseService.updateAbuse(abuse, { state }) .subscribe( - () => this.loadData(), + () => this.reloadData(), err => this.notifier.error(err.message) ) @@ -189,7 +184,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV return Actor.IS_LOCAL(abuse.reporterAccount.host) } - protected loadData () { + protected reloadData () { logger('Loading data.') const options = {