X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fmoderation%2Fvideo-comment-list%2Fvideo-comment-list.component.ts;h=284ec541d919e9300d9b61981030db2b075fd00f;hb=5ed46c1bce29affbe101f126d58657ab484bffe7;hp=d260471259569dff7552502e97e2c780004cbf1a;hpb=7706b3703aeb2bea686b12089959b963a7dd89f4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts index d26047125..284ec541d 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts +++ b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts @@ -14,6 +14,8 @@ import { FeedFormat, UserRight } from '@shared/models' styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-comment-list.component.scss' ] }) export class VideoCommentListComponent extends RestTable implements OnInit, AfterViewInit { + baseRoute = '/admin/moderation/video-comments/list' + comments: VideoCommentAdmin[] totalRecords = 0 sort: SortMeta = { field: 'createdAt', order: -1 } @@ -44,13 +46,13 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte } constructor ( + protected router: Router, + protected route: ActivatedRoute, private auth: AuthService, private notifier: Notifier, private confirmService: ConfirmService, private videoCommentService: VideoCommentService, private markdownRenderer: MarkdownService, - private route: ActivatedRoute, - private router: Router, private bulkService: BulkService ) { super() @@ -75,39 +77,13 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte ngOnInit () { this.initialize() - - this.route.queryParams - .pipe(filter(params => params.search !== undefined && params.search !== null)) - .subscribe(params => { - this.search = params.search - this.setTableFilter(params.search) - this.loadData() - }) + this.listenToSearchChange() } ngAfterViewInit () { if (this.search) this.setTableFilter(this.search) } - onInputSearch (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-comments/list' ], { queryParams }) - } - - resetTableFilter () { - this.setTableFilter('') - this.setQueryParams('') - this.resetSearch() - } - /* END Table filter functions */ - getIdentifier () { return 'VideoCommentListComponent' }