X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-abuse-list%2Fabuse-list-table.component.ts;h=807665b9c4a4da633afc8c790b7d28d18e0ce294;hb=5beb89f223539f1e415a976ff104f772526b4d20;hp=20be94d6e4e81a869cad50ebf257b55dd9c79384;hpb=5d666c0eb25a1b665caa46c4210c1dc2a6b5b333;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 20be94d6e..807665b9c 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 @@ -5,7 +5,7 @@ import { buildVideoLink, buildVideoOrPlaylistEmbed } from 'src/assets/player/uti import { environment } from 'src/environments/environment' import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' -import { ActivatedRoute, Params, Router } from '@angular/router' +import { ActivatedRoute, Router } from '@angular/router' import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core' import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main' import { AbuseService, BlocklistService, VideoBlockService } from '@app/shared/shared-moderation' @@ -37,6 +37,8 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV abuseActions: DropdownAction[][] = [] constructor ( + protected route: ActivatedRoute, + protected router: Router, private notifier: Notifier, private abuseService: AbuseService, private blocklistService: BlocklistService, @@ -45,9 +47,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV private videoBlocklistService: VideoBlockService, private confirmService: ConfirmService, private markdownRenderer: MarkdownService, - private sanitizer: DomSanitizer, - private route: ActivatedRoute, - private router: Router + private sanitizer: DomSanitizer ) { super() } @@ -66,16 +66,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV ] this.initialize() - - this.route.queryParams - .subscribe(params => { - this.search = params.search || '' - - logger('On URL change (search: %s).', this.search) - - this.setTableFilter(this.search) - this.loadData() - }) + this.listenToSearchChange() } ngAfterViewInit () { @@ -98,26 +89,6 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV this.loadData() } - /* Table filter functions */ - onAbuseSearch (event: Event) { - this.onSearch(event) - this.setQueryParams((event.target as HTMLInputElement).value) - } - - setQueryParams (search: string) { - const queryParams: Params = {} - if (search) Object.assign(queryParams, { search }) - - this.router.navigate([ this.baseRoute ], { queryParams }) - } - - resetTableFilter () { - this.setTableFilter('') - this.setQueryParams('') - this.resetSearch() - } - /* END Table filter functions */ - isAbuseAccepted (abuse: AdminAbuse) { return abuse.state.id === AbuseState.ACCEPTED } @@ -141,11 +112,11 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV getVideoEmbed (abuse: AdminAbuse) { return buildVideoOrPlaylistEmbed( buildVideoLink({ - baseUrl: `${environment.embedUrl}/videos/embed/${abuse.video.uuid}`, + baseUrl: `${environment.originServerUrl}/videos/embed/${abuse.video.uuid}`, title: false, warningTitle: false, - startTime: abuse.startAt, - stopTime: abuse.endAt + startTime: abuse.video.startAt, + stopTime: abuse.video.endAt }) ) }