aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-moderation
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-17 11:27:47 +0200
committerChocobozzz <me@florianbigard.com>2021-08-17 14:01:45 +0200
commit1378c0d343028f3d40d7d795422684ab9e6a1599 (patch)
tree08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/shared/shared-moderation
parentc186a67f90203af6bfa434f026efdc99193bcd65 (diff)
downloadPeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz
PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst
PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip
Fix client lint
Diffstat (limited to 'client/src/app/shared/shared-moderation')
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.ts8
-rw-r--r--client/src/app/shared/shared-moderation/report-modals/account-report.component.ts8
-rw-r--r--client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts8
-rw-r--r--client/src/app/shared/shared-moderation/report-modals/video-report.component.ts8
-rw-r--r--client/src/app/shared/shared-moderation/server-blocklist.component.ts8
-rw-r--r--client/src/app/shared/shared-moderation/user-ban-modal.component.ts8
-rw-r--r--client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts112
-rw-r--r--client/src/app/shared/shared-moderation/video-block.component.ts8
8 files changed, 85 insertions, 83 deletions
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
index 1146aeec0..36f2a591b 100644
--- a/client/src/app/shared/shared-moderation/account-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
@@ -62,13 +62,13 @@ export class GenericAccountBlocklistComponent extends RestTable implements OnIni
62 search: this.search 62 search: this.search
63 }) 63 })
64 64
65 return operation.subscribe( 65 return operation.subscribe({
66 resultList => { 66 next: resultList => {
67 this.blockedAccounts = resultList.data 67 this.blockedAccounts = resultList.data
68 this.totalRecords = resultList.total 68 this.totalRecords = resultList.total
69 }, 69 },
70 70
71 err => this.notifier.error(err.message) 71 error: err => this.notifier.error(err.message)
72 ) 72 })
73 } 73 }
74} 74}
diff --git a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts
index cc8875f77..4ec02f11a 100644
--- a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts
+++ b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts
@@ -77,14 +77,14 @@ export class AccountReportComponent extends FormReactive implements OnInit {
77 account: { 77 account: {
78 id: this.account.id 78 id: this.account.id
79 } 79 }
80 }).subscribe( 80 }).subscribe({
81 () => { 81 next: () => {
82 this.notifier.success($localize`Account reported.`) 82 this.notifier.success($localize`Account reported.`)
83 this.hide() 83 this.hide()
84 }, 84 },
85 85
86 err => this.notifier.error(err.message) 86 error: err => this.notifier.error(err.message)
87 ) 87 })
88 } 88 }
89 89
90 isRemote () { 90 isRemote () {
diff --git a/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts
index c7395c7b7..7c0907ce4 100644
--- a/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts
+++ b/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts
@@ -77,14 +77,14 @@ export class CommentReportComponent extends FormReactive implements OnInit {
77 comment: { 77 comment: {
78 id: this.comment.id 78 id: this.comment.id
79 } 79 }
80 }).subscribe( 80 }).subscribe({
81 () => { 81 next: () => {
82 this.notifier.success($localize`Comment reported.`) 82 this.notifier.success($localize`Comment reported.`)
83 this.hide() 83 this.hide()
84 }, 84 },
85 85
86 err => this.notifier.error(err.message) 86 error: err => this.notifier.error(err.message)
87 ) 87 })
88 } 88 }
89 89
90 isRemote () { 90 isRemote () {
diff --git a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
index e509ac88f..278d60ac6 100644
--- a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
+++ b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts
@@ -108,14 +108,14 @@ export class VideoReportComponent extends FormReactive implements OnInit {
108 startAt: hasStart && startAt ? startAt : undefined, 108 startAt: hasStart && startAt ? startAt : undefined,
109 endAt: hasEnd && endAt ? endAt : undefined 109 endAt: hasEnd && endAt ? endAt : undefined
110 } 110 }
111 }).subscribe( 111 }).subscribe({
112 () => { 112 next: () => {
113 this.notifier.success($localize`Video reported.`) 113 this.notifier.success($localize`Video reported.`)
114 this.hide() 114 this.hide()
115 }, 115 },
116 116
117 err => this.notifier.error(err.message) 117 error: err => this.notifier.error(err.message)
118 ) 118 })
119 } 119 }
120 120
121 isRemote () { 121 isRemote () {
diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.ts b/client/src/app/shared/shared-moderation/server-blocklist.component.ts
index 274d8f6e9..da09b1d0e 100644
--- a/client/src/app/shared/shared-moderation/server-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.ts
@@ -88,13 +88,13 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
88 search: this.search 88 search: this.search
89 }) 89 })
90 90
91 return operation.subscribe( 91 return operation.subscribe({
92 resultList => { 92 next: resultList => {
93 this.blockedServers = resultList.data 93 this.blockedServers = resultList.data
94 this.totalRecords = resultList.total 94 this.totalRecords = resultList.total
95 }, 95 },
96 96
97 err => this.notifier.error(err.message) 97 error: err => this.notifier.error(err.message)
98 ) 98 })
99 } 99 }
100} 100}
diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
index afc69a1b8..0a2d5e93a 100644
--- a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
@@ -47,8 +47,8 @@ export class UserBanModalComponent extends FormReactive implements OnInit {
47 const reason = this.form.value['reason'] || undefined 47 const reason = this.form.value['reason'] || undefined
48 48
49 this.userService.banUsers(this.usersToBan, reason) 49 this.userService.banUsers(this.usersToBan, reason)
50 .subscribe( 50 .subscribe({
51 () => { 51 next: () => {
52 const message = Array.isArray(this.usersToBan) 52 const message = Array.isArray(this.usersToBan)
53 ? $localize`${this.usersToBan.length} users banned.` 53 ? $localize`${this.usersToBan.length} users banned.`
54 : $localize`User ${this.usersToBan.username} banned.` 54 : $localize`User ${this.usersToBan.username} banned.`
@@ -59,8 +59,8 @@ export class UserBanModalComponent extends FormReactive implements OnInit {
59 this.hide() 59 this.hide()
60 }, 60 },
61 61
62 err => this.notifier.error(err.message) 62 error: err => this.notifier.error(err.message)
63 ) 63 })
64 } 64 }
65 65
66} 66}
diff --git a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
index 8c5a48d42..9f1e1bf9b 100644
--- a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
+++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
@@ -67,14 +67,14 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
67 if (res === false) return 67 if (res === false) return
68 68
69 this.userService.unbanUsers(user) 69 this.userService.unbanUsers(user)
70 .subscribe( 70 .subscribe({
71 () => { 71 next: () => {
72 this.notifier.success($localize`User ${user.username} unbanned.`) 72 this.notifier.success($localize`User ${user.username} unbanned.`)
73 this.userChanged.emit() 73 this.userChanged.emit()
74 }, 74 },
75 75
76 err => this.notifier.error(err.message) 76 error: err => this.notifier.error(err.message)
77 ) 77 })
78 } 78 }
79 79
80 async removeUser (user: User) { 80 async removeUser (user: User) {
@@ -87,137 +87,139 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
87 const res = await this.confirmService.confirm(message, $localize`Delete`) 87 const res = await this.confirmService.confirm(message, $localize`Delete`)
88 if (res === false) return 88 if (res === false) return
89 89
90 this.userService.removeUser(user).subscribe( 90 this.userService.removeUser(user)
91 () => { 91 .subscribe({
92 this.notifier.success($localize`User ${user.username} deleted.`) 92 next: () => {
93 this.userDeleted.emit() 93 this.notifier.success($localize`User ${user.username} deleted.`)
94 }, 94 this.userDeleted.emit()
95 },
95 96
96 err => this.notifier.error(err.message) 97 error: err => this.notifier.error(err.message)
97 ) 98 })
98 } 99 }
99 100
100 setEmailAsVerified (user: User) { 101 setEmailAsVerified (user: User) {
101 this.userService.updateUser(user.id, { emailVerified: true }).subscribe( 102 this.userService.updateUser(user.id, { emailVerified: true })
102 () => { 103 .subscribe({
103 this.notifier.success($localize`User ${user.username} email set as verified`) 104 next: () => {
104 this.userChanged.emit() 105 this.notifier.success($localize`User ${user.username} email set as verified`)
105 }, 106 this.userChanged.emit()
106 107 },
107 err => this.notifier.error(err.message) 108
108 ) 109 error: err => this.notifier.error(err.message)
110 })
109 } 111 }
110 112
111 blockAccountByUser (account: Account) { 113 blockAccountByUser (account: Account) {
112 this.blocklistService.blockAccountByUser(account) 114 this.blocklistService.blockAccountByUser(account)
113 .subscribe( 115 .subscribe({
114 () => { 116 next: () => {
115 this.notifier.success($localize`Account ${account.nameWithHost} muted.`) 117 this.notifier.success($localize`Account ${account.nameWithHost} muted.`)
116 118
117 this.account.mutedByUser = true 119 this.account.mutedByUser = true
118 this.userChanged.emit() 120 this.userChanged.emit()
119 }, 121 },
120 122
121 err => this.notifier.error(err.message) 123 error: err => this.notifier.error(err.message)
122 ) 124 })
123 } 125 }
124 126
125 unblockAccountByUser (account: Account) { 127 unblockAccountByUser (account: Account) {
126 this.blocklistService.unblockAccountByUser(account) 128 this.blocklistService.unblockAccountByUser(account)
127 .subscribe( 129 .subscribe({
128 () => { 130 next: () => {
129 this.notifier.success($localize`Account ${account.nameWithHost} unmuted.`) 131 this.notifier.success($localize`Account ${account.nameWithHost} unmuted.`)
130 132
131 this.account.mutedByUser = false 133 this.account.mutedByUser = false
132 this.userChanged.emit() 134 this.userChanged.emit()
133 }, 135 },
134 136
135 err => this.notifier.error(err.message) 137 error: err => this.notifier.error(err.message)
136 ) 138 })
137 } 139 }
138 140
139 blockServerByUser (host: string) { 141 blockServerByUser (host: string) {
140 this.blocklistService.blockServerByUser(host) 142 this.blocklistService.blockServerByUser(host)
141 .subscribe( 143 .subscribe({
142 () => { 144 next: () => {
143 this.notifier.success($localize`Instance ${host} muted.`) 145 this.notifier.success($localize`Instance ${host} muted.`)
144 146
145 this.account.mutedServerByUser = true 147 this.account.mutedServerByUser = true
146 this.userChanged.emit() 148 this.userChanged.emit()
147 }, 149 },
148 150
149 err => this.notifier.error(err.message) 151 error: err => this.notifier.error(err.message)
150 ) 152 })
151 } 153 }
152 154
153 unblockServerByUser (host: string) { 155 unblockServerByUser (host: string) {
154 this.blocklistService.unblockServerByUser(host) 156 this.blocklistService.unblockServerByUser(host)
155 .subscribe( 157 .subscribe({
156 () => { 158 next: () => {
157 this.notifier.success($localize`Instance ${host} unmuted.`) 159 this.notifier.success($localize`Instance ${host} unmuted.`)
158 160
159 this.account.mutedServerByUser = false 161 this.account.mutedServerByUser = false
160 this.userChanged.emit() 162 this.userChanged.emit()
161 }, 163 },
162 164
163 err => this.notifier.error(err.message) 165 error: err => this.notifier.error(err.message)
164 ) 166 })
165 } 167 }
166 168
167 blockAccountByInstance (account: Account) { 169 blockAccountByInstance (account: Account) {
168 this.blocklistService.blockAccountByInstance(account) 170 this.blocklistService.blockAccountByInstance(account)
169 .subscribe( 171 .subscribe({
170 () => { 172 next: () => {
171 this.notifier.success($localize`Account ${account.nameWithHost} muted by the instance.`) 173 this.notifier.success($localize`Account ${account.nameWithHost} muted by the instance.`)
172 174
173 this.account.mutedByInstance = true 175 this.account.mutedByInstance = true
174 this.userChanged.emit() 176 this.userChanged.emit()
175 }, 177 },
176 178
177 err => this.notifier.error(err.message) 179 error: err => this.notifier.error(err.message)
178 ) 180 })
179 } 181 }
180 182
181 unblockAccountByInstance (account: Account) { 183 unblockAccountByInstance (account: Account) {
182 this.blocklistService.unblockAccountByInstance(account) 184 this.blocklistService.unblockAccountByInstance(account)
183 .subscribe( 185 .subscribe({
184 () => { 186 next: () => {
185 this.notifier.success($localize`Account ${account.nameWithHost} unmuted by the instance.`) 187 this.notifier.success($localize`Account ${account.nameWithHost} unmuted by the instance.`)
186 188
187 this.account.mutedByInstance = false 189 this.account.mutedByInstance = false
188 this.userChanged.emit() 190 this.userChanged.emit()
189 }, 191 },
190 192
191 err => this.notifier.error(err.message) 193 error: err => this.notifier.error(err.message)
192 ) 194 })
193 } 195 }
194 196
195 blockServerByInstance (host: string) { 197 blockServerByInstance (host: string) {
196 this.blocklistService.blockServerByInstance(host) 198 this.blocklistService.blockServerByInstance(host)
197 .subscribe( 199 .subscribe({
198 () => { 200 next: () => {
199 this.notifier.success($localize`Instance ${host} muted by the instance.`) 201 this.notifier.success($localize`Instance ${host} muted by the instance.`)
200 202
201 this.account.mutedServerByInstance = true 203 this.account.mutedServerByInstance = true
202 this.userChanged.emit() 204 this.userChanged.emit()
203 }, 205 },
204 206
205 err => this.notifier.error(err.message) 207 error: err => this.notifier.error(err.message)
206 ) 208 })
207 } 209 }
208 210
209 unblockServerByInstance (host: string) { 211 unblockServerByInstance (host: string) {
210 this.blocklistService.unblockServerByInstance(host) 212 this.blocklistService.unblockServerByInstance(host)
211 .subscribe( 213 .subscribe({
212 () => { 214 next: () => {
213 this.notifier.success($localize`Instance ${host} unmuted by the instance.`) 215 this.notifier.success($localize`Instance ${host} unmuted by the instance.`)
214 216
215 this.account.mutedServerByInstance = false 217 this.account.mutedServerByInstance = false
216 this.userChanged.emit() 218 this.userChanged.emit()
217 }, 219 },
218 220
219 err => this.notifier.error(err.message) 221 error: err => this.notifier.error(err.message)
220 ) 222 })
221 } 223 }
222 224
223 async bulkRemoveCommentsOf (body: BulkRemoveCommentsOfBody) { 225 async bulkRemoveCommentsOf (body: BulkRemoveCommentsOfBody) {
@@ -226,13 +228,13 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
226 if (res === false) return 228 if (res === false) return
227 229
228 this.bulkService.removeCommentsOf(body) 230 this.bulkService.removeCommentsOf(body)
229 .subscribe( 231 .subscribe({
230 () => { 232 next: () => {
231 this.notifier.success($localize`Will remove comments of this account (may take several minutes).`) 233 this.notifier.success($localize`Will remove comments of this account (may take several minutes).`)
232 }, 234 },
233 235
234 err => this.notifier.error(err.message) 236 error: err => this.notifier.error(err.message)
235 ) 237 })
236 } 238 }
237 239
238 getRouterUserEditLink (user: User) { 240 getRouterUserEditLink (user: User) {
diff --git a/client/src/app/shared/shared-moderation/video-block.component.ts b/client/src/app/shared/shared-moderation/video-block.component.ts
index fb47989dc..bc6952620 100644
--- a/client/src/app/shared/shared-moderation/video-block.component.ts
+++ b/client/src/app/shared/shared-moderation/video-block.component.ts
@@ -55,8 +55,8 @@ export class VideoBlockComponent extends FormReactive implements OnInit {
55 const unfederate = this.video.isLocal ? this.form.value[ 'unfederate' ] : undefined 55 const unfederate = this.video.isLocal ? this.form.value[ 'unfederate' ] : undefined
56 56
57 this.videoBlocklistService.blockVideo(this.video.id, reason, unfederate) 57 this.videoBlocklistService.blockVideo(this.video.id, reason, unfederate)
58 .subscribe( 58 .subscribe({
59 () => { 59 next: () => {
60 this.notifier.success($localize`Video blocked.`) 60 this.notifier.success($localize`Video blocked.`)
61 this.hide() 61 this.hide()
62 62
@@ -66,7 +66,7 @@ export class VideoBlockComponent extends FormReactive implements OnInit {
66 this.videoBlocked.emit() 66 this.videoBlocked.emit()
67 }, 67 },
68 68
69 err => this.notifier.error(err.message) 69 error: err => this.notifier.error(err.message)
70 ) 70 })
71 } 71 }
72} 72}