diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 11:27:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:01:45 +0200 |
commit | 1378c0d343028f3d40d7d795422684ab9e6a1599 (patch) | |
tree | 08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/+admin | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/+admin')
19 files changed, 213 insertions, 206 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 1e8cfb021..538fa6f14 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -267,8 +267,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
267 | this.configService.updateCustomConfig(omit(value, 'instanceCustomHomepage')), | 267 | this.configService.updateCustomConfig(omit(value, 'instanceCustomHomepage')), |
268 | this.customPage.updateInstanceHomepage(value.instanceCustomHomepage.content) | 268 | this.customPage.updateInstanceHomepage(value.instanceCustomHomepage.content) |
269 | ]) | 269 | ]) |
270 | .subscribe( | 270 | .subscribe({ |
271 | ([ resConfig ]) => { | 271 | next: ([ resConfig ]) => { |
272 | const instanceCustomHomepage = { | 272 | const instanceCustomHomepage = { |
273 | content: value.instanceCustomHomepage.content | 273 | content: value.instanceCustomHomepage.content |
274 | } | 274 | } |
@@ -284,8 +284,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
284 | this.notifier.success($localize`Configuration updated.`) | 284 | this.notifier.success($localize`Configuration updated.`) |
285 | }, | 285 | }, |
286 | 286 | ||
287 | err => this.notifier.error(err.message) | 287 | error: err => this.notifier.error(err.message) |
288 | ) | 288 | }) |
289 | } | 289 | } |
290 | 290 | ||
291 | hasConsistentOptions () { | 291 | hasConsistentOptions () { |
@@ -339,8 +339,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
339 | forkJoin([ | 339 | forkJoin([ |
340 | this.configService.getCustomConfig(), | 340 | this.configService.getCustomConfig(), |
341 | this.customPage.getInstanceHomepage() | 341 | this.customPage.getInstanceHomepage() |
342 | ]) | 342 | ]).subscribe({ |
343 | .subscribe(([ config, homepage ]) => { | 343 | next: ([ config, homepage ]) => { |
344 | this.customConfig = { ...config, instanceCustomHomepage: homepage } | 344 | this.customConfig = { ...config, instanceCustomHomepage: homepage } |
345 | 345 | ||
346 | this.updateForm() | 346 | this.updateForm() |
@@ -348,21 +348,21 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
348 | this.forceCheck() | 348 | this.forceCheck() |
349 | }, | 349 | }, |
350 | 350 | ||
351 | err => this.notifier.error(err.message) | 351 | error: err => this.notifier.error(err.message) |
352 | ) | 352 | }) |
353 | } | 353 | } |
354 | 354 | ||
355 | private loadCategoriesAndLanguages () { | 355 | private loadCategoriesAndLanguages () { |
356 | forkJoin([ | 356 | forkJoin([ |
357 | this.serverService.getVideoLanguages(), | 357 | this.serverService.getVideoLanguages(), |
358 | this.serverService.getVideoCategories() | 358 | this.serverService.getVideoCategories() |
359 | ]).subscribe( | 359 | ]).subscribe({ |
360 | ([ languages, categories ]) => { | 360 | next: ([ languages, categories ]) => { |
361 | this.languageItems = languages.map(l => ({ label: l.label, id: l.id })) | 361 | this.languageItems = languages.map(l => ({ label: l.label, id: l.id })) |
362 | this.categoryItems = categories.map(l => ({ label: l.label, id: l.id + '' })) | 362 | this.categoryItems = categories.map(l => ({ label: l.label, id: l.id + '' })) |
363 | }, | 363 | }, |
364 | 364 | ||
365 | err => this.notifier.error(err.message) | 365 | error: err => this.notifier.error(err.message) |
366 | ) | 366 | }) |
367 | } | 367 | } |
368 | } | 368 | } |
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 4a312f6aa..b867b4ba5 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts | |||
@@ -35,17 +35,17 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
35 | follow.state = 'accepted' | 35 | follow.state = 'accepted' |
36 | 36 | ||
37 | this.followService.acceptFollower(follow) | 37 | this.followService.acceptFollower(follow) |
38 | .subscribe( | 38 | .subscribe({ |
39 | () => { | 39 | next: () => { |
40 | const handle = follow.follower.name + '@' + follow.follower.host | 40 | const handle = follow.follower.name + '@' + follow.follower.host |
41 | this.notifier.success($localize`${handle} accepted in instance followers`) | 41 | this.notifier.success($localize`${handle} accepted in instance followers`) |
42 | }, | 42 | }, |
43 | 43 | ||
44 | err => { | 44 | error: err => { |
45 | follow.state = 'pending' | 45 | follow.state = 'pending' |
46 | this.notifier.error(err.message) | 46 | this.notifier.error(err.message) |
47 | } | 47 | } |
48 | ) | 48 | }) |
49 | } | 49 | } |
50 | 50 | ||
51 | async rejectFollower (follow: ActorFollow) { | 51 | async rejectFollower (follow: ActorFollow) { |
@@ -54,19 +54,19 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
54 | if (res === false) return | 54 | if (res === false) return |
55 | 55 | ||
56 | this.followService.rejectFollower(follow) | 56 | this.followService.rejectFollower(follow) |
57 | .subscribe( | 57 | .subscribe({ |
58 | () => { | 58 | next: () => { |
59 | const handle = follow.follower.name + '@' + follow.follower.host | 59 | const handle = follow.follower.name + '@' + follow.follower.host |
60 | this.notifier.success($localize`${handle} rejected from instance followers`) | 60 | this.notifier.success($localize`${handle} rejected from instance followers`) |
61 | 61 | ||
62 | this.reloadData() | 62 | this.reloadData() |
63 | }, | 63 | }, |
64 | 64 | ||
65 | err => { | 65 | error: err => { |
66 | follow.state = 'pending' | 66 | follow.state = 'pending' |
67 | this.notifier.error(err.message) | 67 | this.notifier.error(err.message) |
68 | } | 68 | } |
69 | ) | 69 | }) |
70 | } | 70 | } |
71 | 71 | ||
72 | async deleteFollower (follow: ActorFollow) { | 72 | async deleteFollower (follow: ActorFollow) { |
@@ -75,27 +75,27 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
75 | if (res === false) return | 75 | if (res === false) return |
76 | 76 | ||
77 | this.followService.removeFollower(follow) | 77 | this.followService.removeFollower(follow) |
78 | .subscribe( | 78 | .subscribe({ |
79 | () => { | 79 | next: () => { |
80 | const handle = follow.follower.name + '@' + follow.follower.host | 80 | const handle = follow.follower.name + '@' + follow.follower.host |
81 | this.notifier.success($localize`${handle} removed from instance followers`) | 81 | this.notifier.success($localize`${handle} removed from instance followers`) |
82 | 82 | ||
83 | this.reloadData() | 83 | this.reloadData() |
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 | protected reloadData () { | 90 | protected reloadData () { |
91 | this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search }) | 91 | this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search }) |
92 | .subscribe( | 92 | .subscribe({ |
93 | resultList => { | 93 | next: resultList => { |
94 | this.followers = resultList.data | 94 | this.followers = resultList.data |
95 | this.totalRecords = resultList.total | 95 | this.totalRecords = resultList.total |
96 | }, | 96 | }, |
97 | 97 | ||
98 | err => this.notifier.error(err.message) | 98 | error: err => this.notifier.error(err.message) |
99 | ) | 99 | }) |
100 | } | 100 | } |
101 | } | 101 | } |
diff --git a/client/src/app/+admin/follows/following-list/follow-modal.component.ts b/client/src/app/+admin/follows/following-list/follow-modal.component.ts index dc6909200..c55fc8d81 100644 --- a/client/src/app/+admin/follows/following-list/follow-modal.component.ts +++ b/client/src/app/+admin/follows/following-list/follow-modal.component.ts | |||
@@ -57,13 +57,14 @@ export class FollowModalComponent extends FormReactive implements OnInit { | |||
57 | private async addFollowing () { | 57 | private async addFollowing () { |
58 | const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles']) | 58 | const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles']) |
59 | 59 | ||
60 | this.followService.follow(hostsOrHandles).subscribe( | 60 | this.followService.follow(hostsOrHandles) |
61 | () => { | 61 | .subscribe({ |
62 | this.notifier.success($localize`Follow request(s) sent!`) | 62 | next: () => { |
63 | this.newFollow.emit() | 63 | this.notifier.success($localize`Follow request(s) sent!`) |
64 | }, | 64 | this.newFollow.emit() |
65 | }, | ||
65 | 66 | ||
66 | err => this.notifier.error(err.message) | 67 | error: err => this.notifier.error(err.message) |
67 | ) | 68 | }) |
68 | } | 69 | } |
69 | } | 70 | } |
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index ba62dfa23..cf0225098 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts | |||
@@ -49,25 +49,26 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
49 | ) | 49 | ) |
50 | if (res === false) return | 50 | if (res === false) return |
51 | 51 | ||
52 | this.followService.unfollow(follow).subscribe( | 52 | this.followService.unfollow(follow) |
53 | () => { | 53 | .subscribe({ |
54 | this.notifier.success($localize`You are not following ${follow.following.host} anymore.`) | 54 | next: () => { |
55 | this.reloadData() | 55 | this.notifier.success($localize`You are not following ${follow.following.host} anymore.`) |
56 | }, | 56 | this.reloadData() |
57 | }, | ||
57 | 58 | ||
58 | err => this.notifier.error(err.message) | 59 | error: err => this.notifier.error(err.message) |
59 | ) | 60 | }) |
60 | } | 61 | } |
61 | 62 | ||
62 | protected reloadData () { | 63 | protected reloadData () { |
63 | this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search }) | 64 | this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search }) |
64 | .subscribe( | 65 | .subscribe({ |
65 | resultList => { | 66 | next: resultList => { |
66 | this.following = resultList.data | 67 | this.following = resultList.data |
67 | this.totalRecords = resultList.total | 68 | this.totalRecords = resultList.total |
68 | }, | 69 | }, |
69 | 70 | ||
70 | err => this.notifier.error(err.message) | 71 | error: err => this.notifier.error(err.message) |
71 | ) | 72 | }) |
72 | } | 73 | } |
73 | } | 74 | } |
diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts index 729b7f599..47c402510 100644 --- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts +++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts | |||
@@ -18,14 +18,14 @@ export class RedundancyCheckboxComponent { | |||
18 | 18 | ||
19 | updateRedundancyState () { | 19 | updateRedundancyState () { |
20 | this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) | 20 | this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) |
21 | .subscribe( | 21 | .subscribe({ |
22 | () => { | 22 | next: () => { |
23 | const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled` | 23 | const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled` |
24 | 24 | ||
25 | this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`) | 25 | this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`) |
26 | }, | 26 | }, |
27 | 27 | ||
28 | err => this.notifier.error(err.message) | 28 | error: err => this.notifier.error(err.message) |
29 | ) | 29 | }) |
30 | } | 30 | } |
31 | } | 31 | } |
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index 3cd65dd6e..4c691269a 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts | |||
@@ -142,14 +142,14 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit | |||
142 | if (res === false) return | 142 | if (res === false) return |
143 | 143 | ||
144 | this.redundancyService.removeVideoRedundancies(redundancy) | 144 | this.redundancyService.removeVideoRedundancies(redundancy) |
145 | .subscribe( | 145 | .subscribe({ |
146 | () => { | 146 | next: () => { |
147 | this.notifier.success($localize`Video redundancies removed!`) | 147 | this.notifier.success($localize`Video redundancies removed!`) |
148 | this.reloadData() | 148 | this.reloadData() |
149 | }, | 149 | }, |
150 | 150 | ||
151 | err => this.notifier.error(err.message) | 151 | error: err => this.notifier.error(err.message) |
152 | ) | 152 | }) |
153 | 153 | ||
154 | } | 154 | } |
155 | 155 | ||
@@ -161,14 +161,14 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit | |||
161 | } | 161 | } |
162 | 162 | ||
163 | this.redundancyService.listVideoRedundancies(options) | 163 | this.redundancyService.listVideoRedundancies(options) |
164 | .subscribe( | 164 | .subscribe({ |
165 | resultList => { | 165 | next: resultList => { |
166 | this.videoRedundancies = resultList.data | 166 | this.videoRedundancies = resultList.data |
167 | this.totalRecords = resultList.total | 167 | this.totalRecords = resultList.total |
168 | }, | 168 | }, |
169 | 169 | ||
170 | err => this.notifier.error(err.message) | 170 | error: err => this.notifier.error(err.message) |
171 | ) | 171 | }) |
172 | } | 172 | } |
173 | 173 | ||
174 | private loadSelectLocalStorage () { | 174 | private loadSelectLocalStorage () { |
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 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { AfterViewInit, Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { AuthService, ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core' | 4 | import { AuthService, ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core' |
5 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 5 | import { 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 | } |
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts index 968abcbe5..85f9879bf 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts | |||
@@ -61,16 +61,16 @@ export class PluginListInstalledComponent implements OnInit { | |||
61 | 61 | ||
62 | loadMorePlugins () { | 62 | loadMorePlugins () { |
63 | this.pluginApiService.getPlugins(this.pluginType, this.pagination, this.sort) | 63 | this.pluginApiService.getPlugins(this.pluginType, this.pagination, this.sort) |
64 | .subscribe( | 64 | .subscribe({ |
65 | res => { | 65 | next: res => { |
66 | this.plugins = this.plugins.concat(res.data) | 66 | this.plugins = this.plugins.concat(res.data) |
67 | this.pagination.totalItems = res.total | 67 | this.pagination.totalItems = res.total |
68 | 68 | ||
69 | this.onDataSubject.next(res.data) | 69 | this.onDataSubject.next(res.data) |
70 | }, | 70 | }, |
71 | 71 | ||
72 | err => this.notifier.error(err.message) | 72 | error: err => this.notifier.error(err.message) |
73 | ) | 73 | }) |
74 | } | 74 | } |
75 | 75 | ||
76 | onNearOfBottom () { | 76 | onNearOfBottom () { |
@@ -113,16 +113,16 @@ export class PluginListInstalledComponent implements OnInit { | |||
113 | if (res === false) return | 113 | if (res === false) return |
114 | 114 | ||
115 | this.pluginApiService.uninstall(plugin.name, plugin.type) | 115 | this.pluginApiService.uninstall(plugin.name, plugin.type) |
116 | .subscribe( | 116 | .subscribe({ |
117 | () => { | 117 | next: () => { |
118 | this.notifier.success($localize`${plugin.name} uninstalled.`) | 118 | this.notifier.success($localize`${plugin.name} uninstalled.`) |
119 | 119 | ||
120 | this.plugins = this.plugins.filter(p => p.name !== plugin.name) | 120 | this.plugins = this.plugins.filter(p => p.name !== plugin.name) |
121 | this.pagination.totalItems-- | 121 | this.pagination.totalItems-- |
122 | }, | 122 | }, |
123 | 123 | ||
124 | err => this.notifier.error(err.message) | 124 | error: err => this.notifier.error(err.message) |
125 | ) | 125 | }) |
126 | } | 126 | } |
127 | 127 | ||
128 | async update (plugin: PeerTubePlugin) { | 128 | async update (plugin: PeerTubePlugin) { |
@@ -143,8 +143,8 @@ export class PluginListInstalledComponent implements OnInit { | |||
143 | 143 | ||
144 | this.pluginApiService.update(plugin.name, plugin.type) | 144 | this.pluginApiService.update(plugin.name, plugin.type) |
145 | .pipe() | 145 | .pipe() |
146 | .subscribe( | 146 | .subscribe({ |
147 | res => { | 147 | next: res => { |
148 | this.updating[updatingKey] = false | 148 | this.updating[updatingKey] = false |
149 | 149 | ||
150 | this.notifier.success($localize`${plugin.name} updated.`) | 150 | this.notifier.success($localize`${plugin.name} updated.`) |
@@ -152,8 +152,8 @@ export class PluginListInstalledComponent implements OnInit { | |||
152 | Object.assign(plugin, res) | 152 | Object.assign(plugin, res) |
153 | }, | 153 | }, |
154 | 154 | ||
155 | err => this.notifier.error(err.message) | 155 | error: err => this.notifier.error(err.message) |
156 | ) | 156 | }) |
157 | } | 157 | } |
158 | 158 | ||
159 | getShowRouterLink (plugin: PeerTubePlugin) { | 159 | getShowRouterLink (plugin: PeerTubePlugin) { |
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts index 0a6e57904..803777eb3 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts | |||
@@ -84,8 +84,8 @@ export class PluginSearchComponent implements OnInit { | |||
84 | this.isSearching = true | 84 | this.isSearching = true |
85 | 85 | ||
86 | this.pluginApiService.searchAvailablePlugins(this.pluginType, this.pagination, this.sort, this.search) | 86 | this.pluginApiService.searchAvailablePlugins(this.pluginType, this.pagination, this.sort, this.search) |
87 | .subscribe( | 87 | .subscribe({ |
88 | res => { | 88 | next: res => { |
89 | this.isSearching = false | 89 | this.isSearching = false |
90 | 90 | ||
91 | this.plugins = this.plugins.concat(res.data) | 91 | this.plugins = this.plugins.concat(res.data) |
@@ -94,13 +94,13 @@ export class PluginSearchComponent implements OnInit { | |||
94 | this.onDataSubject.next(res.data) | 94 | this.onDataSubject.next(res.data) |
95 | }, | 95 | }, |
96 | 96 | ||
97 | err => { | 97 | error: err => { |
98 | console.error(err) | 98 | console.error(err) |
99 | 99 | ||
100 | const message = $localize`The plugin index is not available. Please retry later.` | 100 | const message = $localize`The plugin index is not available. Please retry later.` |
101 | this.notifier.error(message) | 101 | this.notifier.error(message) |
102 | } | 102 | } |
103 | ) | 103 | }) |
104 | } | 104 | } |
105 | 105 | ||
106 | onNearOfBottom () { | 106 | onNearOfBottom () { |
@@ -139,8 +139,8 @@ export class PluginSearchComponent implements OnInit { | |||
139 | this.installing[plugin.npmName] = true | 139 | this.installing[plugin.npmName] = true |
140 | 140 | ||
141 | this.pluginApiService.install(plugin.npmName) | 141 | this.pluginApiService.install(plugin.npmName) |
142 | .subscribe( | 142 | .subscribe({ |
143 | () => { | 143 | next: () => { |
144 | this.installing[plugin.npmName] = false | 144 | this.installing[plugin.npmName] = false |
145 | this.pluginInstalled = true | 145 | this.pluginInstalled = true |
146 | 146 | ||
@@ -149,7 +149,7 @@ export class PluginSearchComponent implements OnInit { | |||
149 | plugin.installed = true | 149 | plugin.installed = true |
150 | }, | 150 | }, |
151 | 151 | ||
152 | err => this.notifier.error(err.message) | 152 | error: err => this.notifier.error(err.message) |
153 | ) | 153 | }) |
154 | } | 154 | } |
155 | } | 155 | } |
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts index c3d14d2b3..10fb52911 100644 --- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts | |||
@@ -50,13 +50,13 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit | |||
50 | const settings = this.form.value | 50 | const settings = this.form.value |
51 | 51 | ||
52 | this.pluginAPIService.updatePluginSettings(this.plugin.name, this.plugin.type, settings) | 52 | this.pluginAPIService.updatePluginSettings(this.plugin.name, this.plugin.type, settings) |
53 | .subscribe( | 53 | .subscribe({ |
54 | () => { | 54 | next: () => { |
55 | this.notifier.success($localize`Settings updated.`) | 55 | this.notifier.success($localize`Settings updated.`) |
56 | }, | 56 | }, |
57 | 57 | ||
58 | err => this.notifier.error(err.message) | 58 | error: err => this.notifier.error(err.message) |
59 | ) | 59 | }) |
60 | } | 60 | } |
61 | 61 | ||
62 | hasRegisteredSettings () { | 62 | hasRegisteredSettings () { |
@@ -83,8 +83,8 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit | |||
83 | return this.pluginAPIService.getPluginRegisteredSettings(plugin.name, plugin.type) | 83 | return this.pluginAPIService.getPluginRegisteredSettings(plugin.name, plugin.type) |
84 | .pipe(map(data => ({ plugin, registeredSettings: data.registeredSettings }))) | 84 | .pipe(map(data => ({ plugin, registeredSettings: data.registeredSettings }))) |
85 | })) | 85 | })) |
86 | .subscribe( | 86 | .subscribe({ |
87 | async ({ plugin, registeredSettings }) => { | 87 | next: async ({ plugin, registeredSettings }) => { |
88 | this.plugin = plugin | 88 | this.plugin = plugin |
89 | 89 | ||
90 | this.registeredSettings = await this.translateSettings(registeredSettings) | 90 | this.registeredSettings = await this.translateSettings(registeredSettings) |
@@ -94,8 +94,8 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit | |||
94 | this.buildSettingsForm() | 94 | this.buildSettingsForm() |
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 | ||
101 | private buildSettingsForm () { | 101 | private buildSettingsForm () { |
diff --git a/client/src/app/+admin/system/debug/debug.component.ts b/client/src/app/+admin/system/debug/debug.component.ts index a88d837f3..1f4e71e8a 100644 --- a/client/src/app/+admin/system/debug/debug.component.ts +++ b/client/src/app/+admin/system/debug/debug.component.ts | |||
@@ -22,10 +22,10 @@ export class DebugComponent implements OnInit { | |||
22 | 22 | ||
23 | load () { | 23 | load () { |
24 | this.debugService.getDebug() | 24 | this.debugService.getDebug() |
25 | .subscribe( | 25 | .subscribe({ |
26 | debug => this.debug = debug, | 26 | next: debug => this.debug = debug, |
27 | 27 | ||
28 | err => this.notifier.error(err.message) | 28 | error: err => this.notifier.error(err.message) |
29 | ) | 29 | }) |
30 | } | 30 | } |
31 | } | 31 | } |
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts index 4b02e1bc1..b12d7f80a 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.ts +++ b/client/src/app/+admin/system/jobs/jobs.component.ts | |||
@@ -119,14 +119,14 @@ export class JobsComponent extends RestTable implements OnInit { | |||
119 | pagination: this.pagination, | 119 | pagination: this.pagination, |
120 | sort: this.sort | 120 | sort: this.sort |
121 | }) | 121 | }) |
122 | .subscribe( | 122 | .subscribe({ |
123 | resultList => { | 123 | next: resultList => { |
124 | this.jobs = resultList.data | 124 | this.jobs = resultList.data |
125 | this.totalRecords = resultList.total | 125 | this.totalRecords = resultList.total |
126 | }, | 126 | }, |
127 | 127 | ||
128 | err => this.notifier.error(err.message) | 128 | error: err => this.notifier.error(err.message) |
129 | ) | 129 | }) |
130 | } | 130 | } |
131 | 131 | ||
132 | private loadJobStateAndType () { | 132 | private loadJobStateAndType () { |
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts index 48318f07b..865ab80a2 100644 --- a/client/src/app/+admin/system/logs/logs.component.ts +++ b/client/src/app/+admin/system/logs/logs.component.ts | |||
@@ -52,8 +52,8 @@ export class LogsComponent implements OnInit { | |||
52 | this.loading = true | 52 | this.loading = true |
53 | 53 | ||
54 | this.logsService.getLogs({ isAuditLog: this.isAuditLog(), level: this.level, startDate: this.startDate }) | 54 | this.logsService.getLogs({ isAuditLog: this.isAuditLog(), level: this.level, startDate: this.startDate }) |
55 | .subscribe( | 55 | .subscribe({ |
56 | logs => { | 56 | next: logs => { |
57 | this.logs = logs | 57 | this.logs = logs |
58 | 58 | ||
59 | setTimeout(() => { | 59 | setTimeout(() => { |
@@ -61,10 +61,10 @@ export class LogsComponent implements OnInit { | |||
61 | }) | 61 | }) |
62 | }, | 62 | }, |
63 | 63 | ||
64 | err => this.notifier.error(err.message), | 64 | error: err => this.notifier.error(err.message), |
65 | 65 | ||
66 | () => this.loading = false | 66 | complete: () => this.loading = false |
67 | ) | 67 | }) |
68 | } | 68 | } |
69 | 69 | ||
70 | isAuditLog () { | 70 | isAuditLog () { |
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts index c26ad1208..8403db91a 100644 --- a/client/src/app/+admin/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/users/user-edit/user-create.component.ts | |||
@@ -71,14 +71,15 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
71 | userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10) | 71 | userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10) |
72 | userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10) | 72 | userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10) |
73 | 73 | ||
74 | this.userService.addUser(userCreate).subscribe( | 74 | this.userService.addUser(userCreate) |
75 | () => { | 75 | .subscribe({ |
76 | this.notifier.success($localize`User ${userCreate.username} created.`) | 76 | next: () => { |
77 | this.router.navigate([ '/admin/users/list' ]) | 77 | this.notifier.success($localize`User ${userCreate.username} created.`) |
78 | }, | 78 | this.router.navigate([ '/admin/users/list' ]) |
79 | }, | ||
79 | 80 | ||
80 | err => this.error = err.message | 81 | error: err => this.error = err.message |
81 | ) | 82 | }) |
82 | } | 83 | } |
83 | 84 | ||
84 | isCreation () { | 85 | isCreation () { |
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts index 05d52b17f..7c42b9241 100644 --- a/client/src/app/+admin/users/user-edit/user-password.component.ts +++ b/client/src/app/+admin/users/user-edit/user-password.component.ts | |||
@@ -35,13 +35,12 @@ export class UserPasswordComponent extends FormReactive implements OnInit { | |||
35 | 35 | ||
36 | const userUpdate: UserUpdate = this.form.value | 36 | const userUpdate: UserUpdate = this.form.value |
37 | 37 | ||
38 | this.userService.updateUser(this.userId, userUpdate).subscribe( | 38 | this.userService.updateUser(this.userId, userUpdate) |
39 | () => { | 39 | .subscribe({ |
40 | this.notifier.success($localize`Password changed for user ${this.username}.`) | 40 | next: () => this.notifier.success($localize`Password changed for user ${this.username}.`), |
41 | }, | ||
42 | 41 | ||
43 | err => this.error = err.message | 42 | error: err => this.error = err.message |
44 | ) | 43 | }) |
45 | } | 44 | } |
46 | 45 | ||
47 | togglePasswordVisibility () { | 46 | togglePasswordVisibility () { |
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts index 1527508f7..2128ba4fd 100644 --- a/client/src/app/+admin/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/users/user-edit/user-update.component.ts | |||
@@ -59,11 +59,12 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
59 | 59 | ||
60 | this.paramsSub = this.route.params.subscribe(routeParams => { | 60 | this.paramsSub = this.route.params.subscribe(routeParams => { |
61 | const userId = routeParams['id'] | 61 | const userId = routeParams['id'] |
62 | this.userService.getUser(userId, true).subscribe( | 62 | this.userService.getUser(userId, true) |
63 | user => this.onUserFetched(user), | 63 | .subscribe({ |
64 | next: user => this.onUserFetched(user), | ||
64 | 65 | ||
65 | err => this.error = err.message | 66 | error: err => this.error = err.message |
66 | ) | 67 | }) |
67 | }) | 68 | }) |
68 | } | 69 | } |
69 | 70 | ||
@@ -83,14 +84,15 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
83 | 84 | ||
84 | if (userUpdate.pluginAuth === 'null') userUpdate.pluginAuth = null | 85 | if (userUpdate.pluginAuth === 'null') userUpdate.pluginAuth = null |
85 | 86 | ||
86 | this.userService.updateUser(this.user.id, userUpdate).subscribe( | 87 | this.userService.updateUser(this.user.id, userUpdate) |
87 | () => { | 88 | .subscribe({ |
88 | this.notifier.success($localize`User ${this.user.username} updated.`) | 89 | next: () => { |
89 | this.router.navigate([ '/admin/users/list' ]) | 90 | this.notifier.success($localize`User ${this.user.username} updated.`) |
90 | }, | 91 | this.router.navigate([ '/admin/users/list' ]) |
92 | }, | ||
91 | 93 | ||
92 | err => this.error = err.message | 94 | error: err => this.error = err.message |
93 | ) | 95 | }) |
94 | } | 96 | } |
95 | 97 | ||
96 | isCreation () { | 98 | isCreation () { |
@@ -106,13 +108,14 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { | |||
106 | } | 108 | } |
107 | 109 | ||
108 | resetPassword () { | 110 | resetPassword () { |
109 | this.userService.askResetPassword(this.user.email).subscribe( | 111 | this.userService.askResetPassword(this.user.email) |
110 | () => { | 112 | .subscribe({ |
111 | this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`) | 113 | next: () => { |
112 | }, | 114 | this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`) |
113 | 115 | }, | |
114 | err => this.error = err.message | 116 | |
115 | ) | 117 | error: err => this.error = err.message |
118 | }) | ||
116 | } | 119 | } |
117 | 120 | ||
118 | private onUserFetched (userJson: UserType) { | 121 | private onUserFetched (userJson: UserType) { |
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts index e3ae68a93..d4406549a 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.ts +++ b/client/src/app/+admin/users/user-list/user-list.component.ts | |||
@@ -173,14 +173,14 @@ export class UserListComponent extends RestTable implements OnInit { | |||
173 | if (res === false) return | 173 | if (res === false) return |
174 | 174 | ||
175 | this.userService.unbanUsers(users) | 175 | this.userService.unbanUsers(users) |
176 | .subscribe( | 176 | .subscribe({ |
177 | () => { | 177 | next: () => { |
178 | this.notifier.success($localize`${users.length} users unbanned.`) | 178 | this.notifier.success($localize`${users.length} users unbanned.`) |
179 | this.reloadData() | 179 | this.reloadData() |
180 | }, | 180 | }, |
181 | 181 | ||
182 | err => this.notifier.error(err.message) | 182 | error: err => this.notifier.error(err.message) |
183 | ) | 183 | }) |
184 | } | 184 | } |
185 | 185 | ||
186 | async removeUsers (users: User[]) { | 186 | async removeUsers (users: User[]) { |
@@ -195,25 +195,27 @@ export class UserListComponent extends RestTable implements OnInit { | |||
195 | const res = await this.confirmService.confirm(message, $localize`Delete`) | 195 | const res = await this.confirmService.confirm(message, $localize`Delete`) |
196 | if (res === false) return | 196 | if (res === false) return |
197 | 197 | ||
198 | this.userService.removeUser(users).subscribe( | 198 | this.userService.removeUser(users) |
199 | () => { | 199 | .subscribe({ |
200 | this.notifier.success($localize`${users.length} users deleted.`) | 200 | next: () => { |
201 | this.reloadData() | 201 | this.notifier.success($localize`${users.length} users deleted.`) |
202 | }, | 202 | this.reloadData() |
203 | }, | ||
203 | 204 | ||
204 | err => this.notifier.error(err.message) | 205 | error: err => this.notifier.error(err.message) |
205 | ) | 206 | }) |
206 | } | 207 | } |
207 | 208 | ||
208 | async setEmailsAsVerified (users: User[]) { | 209 | async setEmailsAsVerified (users: User[]) { |
209 | this.userService.updateUsers(users, { emailVerified: true }).subscribe( | 210 | this.userService.updateUsers(users, { emailVerified: true }) |
210 | () => { | 211 | .subscribe({ |
211 | this.notifier.success($localize`${users.length} users email set as verified.`) | 212 | next: () => { |
212 | this.reloadData() | 213 | this.notifier.success($localize`${users.length} users email set as verified.`) |
213 | }, | 214 | this.reloadData() |
215 | }, | ||
214 | 216 | ||
215 | err => this.notifier.error(err.message) | 217 | error: err => this.notifier.error(err.message) |
216 | ) | 218 | }) |
217 | } | 219 | } |
218 | 220 | ||
219 | isInSelectionMode () { | 221 | isInSelectionMode () { |
@@ -227,13 +229,13 @@ export class UserListComponent extends RestTable implements OnInit { | |||
227 | pagination: this.pagination, | 229 | pagination: this.pagination, |
228 | sort: this.sort, | 230 | sort: this.sort, |
229 | search: this.search | 231 | search: this.search |
230 | }).subscribe( | 232 | }).subscribe({ |
231 | resultList => { | 233 | next: resultList => { |
232 | this.users = resultList.data | 234 | this.users = resultList.data |
233 | this.totalRecords = resultList.total | 235 | this.totalRecords = resultList.total |
234 | }, | 236 | }, |
235 | 237 | ||
236 | err => this.notifier.error(err.message) | 238 | error: err => this.notifier.error(err.message) |
237 | ) | 239 | }) |
238 | } | 240 | } |
239 | } | 241 | } |