diff options
Diffstat (limited to 'client/src/app/+admin/users')
4 files changed, 58 insertions, 53 deletions
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 | } |