diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-17 15:48:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-17 15:48:54 +0100 |
commit | 3f6441e09af842b4a49639cc7562865eace024bc (patch) | |
tree | d999de949e91c79f262387fe4d87bdb3e3416b47 /client/src/app | |
parent | ac2b052d5448a6c3a590f5f567a5297d8c41966c (diff) | |
download | PeerTube-3f6441e09af842b4a49639cc7562865eace024bc.tar.gz PeerTube-3f6441e09af842b4a49639cc7562865eace024bc.tar.zst PeerTube-3f6441e09af842b4a49639cc7562865eace024bc.zip |
Fix admin table filters
Diffstat (limited to 'client/src/app')
5 files changed, 10 insertions, 6 deletions
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..82c371f4d 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 | |||
@@ -108,7 +108,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV | |||
108 | } | 108 | } |
109 | 109 | ||
110 | ngAfterViewInit () { | 110 | ngAfterViewInit () { |
111 | if (this.search) this.setTableFilter(this.search) | 111 | if (this.search) this.setTableFilter(this.search, false) |
112 | } | 112 | } |
113 | 113 | ||
114 | /* Table filter functions */ | 114 | /* Table filter functions */ |
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html index 8ec4ebbb2..8c68b0abf 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html +++ b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html | |||
@@ -123,7 +123,7 @@ | |||
123 | 123 | ||
124 | <ng-template pTemplate="emptymessage"> | 124 | <ng-template pTemplate="emptymessage"> |
125 | <tr> | 125 | <tr> |
126 | <td colspan="5"> | 126 | <td colspan="7"> |
127 | <div class="no-results"> | 127 | <div class="no-results"> |
128 | <ng-container *ngIf="search" i18n>No comments found matching current filters.</ng-container> | 128 | <ng-container *ngIf="search" i18n>No comments found matching current filters.</ng-container> |
129 | <ng-container *ngIf="!search" i18n>No comments found.</ng-container> | 129 | <ng-container *ngIf="!search" i18n>No comments found.</ng-container> |
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 529e28f11..63493d00d 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 | |||
@@ -92,7 +92,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte | |||
92 | } | 92 | } |
93 | 93 | ||
94 | ngAfterViewInit () { | 94 | ngAfterViewInit () { |
95 | if (this.search) this.setTableFilter(this.search) | 95 | if (this.search) this.setTableFilter(this.search, false) |
96 | } | 96 | } |
97 | 97 | ||
98 | getIdentifier () { | 98 | getIdentifier () { |
diff --git a/client/src/app/core/rest/rest-table.ts b/client/src/app/core/rest/rest-table.ts index d53cac4c8..32c1db446 100644 --- a/client/src/app/core/rest/rest-table.ts +++ b/client/src/app/core/rest/rest-table.ts | |||
@@ -131,10 +131,14 @@ export abstract class RestTable { | |||
131 | this.expandedRows = {} | 131 | this.expandedRows = {} |
132 | } | 132 | } |
133 | 133 | ||
134 | setTableFilter (filter: string) { | 134 | setTableFilter (filter: string, triggerEvent = true) { |
135 | // FIXME: cannot use ViewChild, so create a component for the filter input | 135 | // FIXME: cannot use ViewChild, so create a component for the filter input |
136 | const filterInput = document.getElementById('table-filter') as HTMLInputElement | 136 | const filterInput = document.getElementById('table-filter') as HTMLInputElement |
137 | if (filterInput) filterInput.value = filter | 137 | if (!filterInput) return |
138 | |||
139 | filterInput.value = filter | ||
140 | |||
141 | if (triggerEvent) filterInput.dispatchEvent(new Event('keyup')) | ||
138 | } | 142 | } |
139 | 143 | ||
140 | resetSearch () { | 144 | resetSearch () { |
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 904f62b57..e34836a18 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 | |||
@@ -70,7 +70,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV | |||
70 | } | 70 | } |
71 | 71 | ||
72 | ngAfterViewInit () { | 72 | ngAfterViewInit () { |
73 | if (this.search) this.setTableFilter(this.search) | 73 | if (this.search) this.setTableFilter(this.search, false) |
74 | } | 74 | } |
75 | 75 | ||
76 | isAdminView () { | 76 | isAdminView () { |