diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-03 14:33:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-03 16:42:15 +0200 |
commit | 2e46eb97154da909b82d5efe1d336a3412594ff0 (patch) | |
tree | a86b6ca6439f62c8498887c4e1c3ece9a302d116 /client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts | |
parent | 514e8168fbad08e70ce12dab587f720b4e91b19e (diff) | |
download | PeerTube-2e46eb97154da909b82d5efe1d336a3412594ff0.tar.gz PeerTube-2e46eb97154da909b82d5efe1d336a3412594ff0.tar.zst PeerTube-2e46eb97154da909b82d5efe1d336a3412594ff0.zip |
Refactor search filters
Diffstat (limited to 'client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts')
-rw-r--r-- | client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts | 15 |
1 files changed, 4 insertions, 11 deletions
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 ebbbddb43..e2ae993b0 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 | |||
@@ -13,9 +13,7 @@ import { FeedFormat, UserRight } from '@shared/models' | |||
13 | templateUrl: './video-comment-list.component.html', | 13 | templateUrl: './video-comment-list.component.html', |
14 | styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-comment-list.component.scss' ] | 14 | styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-comment-list.component.scss' ] |
15 | }) | 15 | }) |
16 | export class VideoCommentListComponent extends RestTable implements OnInit, AfterViewInit { | 16 | export class VideoCommentListComponent extends RestTable implements OnInit { |
17 | baseRoute = '/admin/moderation/video-comments/list' | ||
18 | |||
19 | comments: VideoCommentAdmin[] | 17 | comments: VideoCommentAdmin[] |
20 | totalRecords = 0 | 18 | totalRecords = 0 |
21 | sort: SortMeta = { field: 'createdAt', order: -1 } | 19 | sort: SortMeta = { field: 'createdAt', order: -1 } |
@@ -91,7 +89,6 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte | |||
91 | 89 | ||
92 | ngOnInit () { | 90 | ngOnInit () { |
93 | this.initialize() | 91 | this.initialize() |
94 | this.listenToSearchChange() | ||
95 | 92 | ||
96 | this.bulkCommentActions = [ | 93 | this.bulkCommentActions = [ |
97 | { | 94 | { |
@@ -103,10 +100,6 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte | |||
103 | ] | 100 | ] |
104 | } | 101 | } |
105 | 102 | ||
106 | ngAfterViewInit () { | ||
107 | if (this.search) this.setTableFilter(this.search, false) | ||
108 | } | ||
109 | |||
110 | getIdentifier () { | 103 | getIdentifier () { |
111 | return 'VideoCommentListComponent' | 104 | return 'VideoCommentListComponent' |
112 | } | 105 | } |
@@ -119,7 +112,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte | |||
119 | return this.selectedComments.length !== 0 | 112 | return this.selectedComments.length !== 0 |
120 | } | 113 | } |
121 | 114 | ||
122 | protected loadData () { | 115 | protected reloadData () { |
123 | this.videoCommentService.getAdminVideoComments({ | 116 | this.videoCommentService.getAdminVideoComments({ |
124 | pagination: this.pagination, | 117 | pagination: this.pagination, |
125 | sort: this.sort, | 118 | sort: this.sort, |
@@ -147,7 +140,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte | |||
147 | this.videoCommentService.deleteVideoComments(commentArgs).subscribe( | 140 | this.videoCommentService.deleteVideoComments(commentArgs).subscribe( |
148 | () => { | 141 | () => { |
149 | this.notifier.success($localize`${commentArgs.length} comments deleted.`) | 142 | this.notifier.success($localize`${commentArgs.length} comments deleted.`) |
150 | this.loadData() | 143 | this.reloadData() |
151 | }, | 144 | }, |
152 | 145 | ||
153 | err => this.notifier.error(err.message), | 146 | err => this.notifier.error(err.message), |
@@ -159,7 +152,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte | |||
159 | private deleteComment (comment: VideoCommentAdmin) { | 152 | private deleteComment (comment: VideoCommentAdmin) { |
160 | this.videoCommentService.deleteVideoComment(comment.video.id, comment.id) | 153 | this.videoCommentService.deleteVideoComment(comment.video.id, comment.id) |
161 | .subscribe( | 154 | .subscribe( |
162 | () => this.loadData(), | 155 | () => this.reloadData(), |
163 | 156 | ||
164 | err => this.notifier.error(err.message) | 157 | err => this.notifier.error(err.message) |
165 | ) | 158 | ) |