X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fmoderation%2Fvideo-block-list%2Fvideo-block-list.component.ts;h=dfd8dc745e3a76351d975fce90748cc1bde518ec;hb=1fd61899eaea245a5844e33e21f04b2562f16e5e;hp=aa6b5d0a9c185e360681db870052a0ff5daf8695;hpb=5beb89f223539f1e415a976ff104f772526b4d20;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index aa6b5d0a9..dfd8dc745 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts @@ -6,6 +6,7 @@ import { AfterViewInit, Component, OnInit } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' import { ActivatedRoute, Params, Router } from '@angular/router' import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' +import { AdvancedInputFilter } from '@app/shared/shared-forms' import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' import { VideoBlockService } from '@app/shared/shared-moderation' import { VideoBlacklist, VideoBlacklistType } from '@shared/models' @@ -24,6 +25,17 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV videoBlocklistActions: DropdownAction[][] = [] + inputFilters: AdvancedInputFilter[] = [ + { + queryParams: { 'search': 'type:auto' }, + label: $localize`Automatic blocks` + }, + { + queryParams: { 'search': 'type:manual' }, + label: $localize`Manual blocks` + } + ] + constructor ( protected route: ActivatedRoute, protected router: Router, @@ -108,27 +120,8 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV } ngAfterViewInit () { - if (this.search) this.setTableFilter(this.search) - } - - /* Table filter functions */ - onBlockSearch (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([ '/admin/moderation/video-blocks/list' ], { queryParams }) - } - - resetTableFilter () { - this.setTableFilter('') - this.setQueryParams('') - this.resetSearch() + if (this.search) this.setTableFilter(this.search, false) } - /* END Table filter functions */ getIdentifier () { return 'VideoBlockListComponent' @@ -164,7 +157,8 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV baseUrl: `${environment.originServerUrl}/videos/embed/${entry.video.uuid}`, title: false, warningTitle: false - }) + }), + entry.video.name ) }