aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/moderation')
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts41
-rw-r--r--client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html8
-rw-r--r--client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts59
3 files changed, 54 insertions, 54 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 4fe5ec441..adef16975 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
@@ -62,14 +62,14 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
62 handler: videoBlock => { 62 handler: videoBlock => {
63 this.videoBlocklistService.unblockVideo(videoBlock.video.id).pipe( 63 this.videoBlocklistService.unblockVideo(videoBlock.video.id).pipe(
64 switchMap(_ => this.videoBlocklistService.blockVideo(videoBlock.video.id, undefined, true)) 64 switchMap(_ => this.videoBlocklistService.blockVideo(videoBlock.video.id, undefined, true))
65 ).subscribe( 65 ).subscribe({
66 () => { 66 next: () => {
67 this.notifier.success($localize`Video ${videoBlock.video.name} switched to manual block.`) 67 this.notifier.success($localize`Video ${videoBlock.video.name} switched to manual block.`)
68 this.reloadData() 68 this.reloadData()
69 }, 69 },
70 70
71 err => this.notifier.error(err.message) 71 error: err => this.notifier.error(err.message)
72 ) 72 })
73 }, 73 },
74 isDisplayed: videoBlock => videoBlock.type === VideoBlacklistType.AUTO_BEFORE_PUBLISHED 74 isDisplayed: videoBlock => videoBlock.type === VideoBlacklistType.AUTO_BEFORE_PUBLISHED
75 } 75 }
@@ -94,13 +94,11 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
94 if (res === false) return 94 if (res === false) return
95 95
96 this.videoService.removeVideo(videoBlock.video.id) 96 this.videoService.removeVideo(videoBlock.video.id)
97 .subscribe( 97 .subscribe({
98 () => { 98 next: () => this.notifier.success($localize`Video deleted.`),
99 this.notifier.success($localize`Video deleted.`)
100 },
101 99
102 err => this.notifier.error(err.message) 100 error: err => this.notifier.error(err.message)
103 ) 101 })
104 } 102 }
105 } 103 }
106 ] 104 ]
@@ -136,14 +134,15 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
136 const res = await this.confirmService.confirm(confirmMessage, $localize`Unblock`) 134 const res = await this.confirmService.confirm(confirmMessage, $localize`Unblock`)
137 if (res === false) return 135 if (res === false) return
138 136
139 this.videoBlocklistService.unblockVideo(entry.video.id).subscribe( 137 this.videoBlocklistService.unblockVideo(entry.video.id)
140 () => { 138 .subscribe({
141 this.notifier.success($localize`Video ${entry.video.name} unblocked.`) 139 next: () => {
142 this.reloadData() 140 this.notifier.success($localize`Video ${entry.video.name} unblocked.`)
143 }, 141 this.reloadData()
142 },
144 143
145 err => this.notifier.error(err.message) 144 error: err => this.notifier.error(err.message)
146 ) 145 })
147 } 146 }
148 147
149 getVideoEmbed (entry: VideoBlacklist) { 148 getVideoEmbed (entry: VideoBlacklist) {
@@ -164,8 +163,8 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
164 sort: this.sort, 163 sort: this.sort,
165 search: this.search 164 search: this.search
166 }) 165 })
167 .subscribe( 166 .subscribe({
168 async resultList => { 167 next: async resultList => {
169 this.totalRecords = resultList.total 168 this.totalRecords = resultList.total
170 169
171 this.blocklist = resultList.data 170 this.blocklist = resultList.data
@@ -178,7 +177,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
178 } 177 }
179 }, 178 },
180 179
181 err => this.notifier.error(err.message) 180 error: err => this.notifier.error(err.message)
182 ) 181 })
183 } 182 }
184} 183}
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 9d9283536..0fd0588ba 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
@@ -34,13 +34,13 @@
34 34
35 <ng-template pTemplate="header"> 35 <ng-template pTemplate="header">
36 <tr> 36 <tr>
37 <th style="width: 40px"> 37 <th style="width: 40px;">
38 <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox> 38 <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
39 </th> 39 </th>
40 <th style="width: 40px"></th> 40 <th style="width: 40px;"></th>
41 <th style="width: 150px;"></th> 41 <th style="width: 150px;"></th>
42 <th style="width: 300px" i18n>Account</th> 42 <th style="width: 300px;" i18n>Account</th>
43 <th style="width: 300px" i18n>Video</th> 43 <th style="width: 300px;" i18n>Video</th>
44 <th i18n>Comment</th> 44 <th i18n>Comment</th>
45 <th style="width: 150px;" i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th> 45 <th style="width: 150px;" i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th>
46 </tr> 46 </tr>
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 e2ae993b0..4904bcc25 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
@@ -1,5 +1,5 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { AfterViewInit, Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { AuthService, ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core' 4import { AuthService, ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core'
5import { AdvancedInputFilter } from '@app/shared/shared-forms' 5import { AdvancedInputFilter } from '@app/shared/shared-forms'
@@ -117,45 +117,46 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
117 pagination: this.pagination, 117 pagination: this.pagination,
118 sort: this.sort, 118 sort: this.sort,
119 search: this.search 119 search: this.search
120 }).subscribe( 120 }).subscribe({
121 async resultList => { 121 next: async resultList => {
122 this.totalRecords = resultList.total 122 this.totalRecords = resultList.total
123 123
124 this.comments = [] 124 this.comments = []
125 125
126 for (const c of resultList.data) { 126 for (const c of resultList.data) {
127 this.comments.push( 127 this.comments.push(
128 new VideoCommentAdmin(c, await this.toHtml(c.text)) 128 new VideoCommentAdmin(c, await this.toHtml(c.text))
129 ) 129 )
130 } 130 }
131 }, 131 },
132 132
133 err => this.notifier.error(err.message) 133 error: err => this.notifier.error(err.message)
134 ) 134 })
135 } 135 }
136 136
137 private async removeComments (comments: VideoCommentAdmin[]) { 137 private async removeComments (comments: VideoCommentAdmin[]) {
138 const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id })) 138 const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id }))
139 139
140 this.videoCommentService.deleteVideoComments(commentArgs).subscribe( 140 this.videoCommentService.deleteVideoComments(commentArgs)
141 () => { 141 .subscribe({
142 this.notifier.success($localize`${commentArgs.length} comments deleted.`) 142 next: () => {
143 this.reloadData() 143 this.notifier.success($localize`${commentArgs.length} comments deleted.`)
144 }, 144 this.reloadData()
145 },
145 146
146 err => this.notifier.error(err.message), 147 error: err => this.notifier.error(err.message),
147 148
148 () => this.selectedComments = [] 149 complete: () => this.selectedComments = []
149 ) 150 })
150 } 151 }
151 152
152 private deleteComment (comment: VideoCommentAdmin) { 153 private deleteComment (comment: VideoCommentAdmin) {
153 this.videoCommentService.deleteVideoComment(comment.video.id, comment.id) 154 this.videoCommentService.deleteVideoComment(comment.video.id, comment.id)
154 .subscribe( 155 .subscribe({
155 () => this.reloadData(), 156 next: () => this.reloadData(),
156 157
157 err => this.notifier.error(err.message) 158 error: err => this.notifier.error(err.message)
158 ) 159 })
159 } 160 }
160 161
161 private async deleteUserComments (comment: VideoCommentAdmin) { 162 private async deleteUserComments (comment: VideoCommentAdmin) {
@@ -169,12 +170,12 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
169 } 170 }
170 171
171 this.bulkService.removeCommentsOf(options) 172 this.bulkService.removeCommentsOf(options)
172 .subscribe( 173 .subscribe({
173 () => { 174 next: () => {
174 this.notifier.success($localize`Comments of ${options.accountName} will be deleted in a few minutes`) 175 this.notifier.success($localize`Comments of ${options.accountName} will be deleted in a few minutes`)
175 }, 176 },
176 177
177 err => this.notifier.error(err.message) 178 error: err => this.notifier.error(err.message)
178 ) 179 })
179 } 180 }
180} 181}