aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit/user-password.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-27 09:36:37 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit00004f7f6b966a975498612117212b5373f4103c (patch)
tree4899b77da3c55bf1fbb77f927d9da5cd873e2c2a /client/src/app/+admin/users/user-edit/user-password.component.ts
parentbd898dd76babf6ab33a0040297bfb40a69a69dda (diff)
downloadPeerTube-00004f7f6b966a975498612117212b5373f4103c.tar.gz
PeerTube-00004f7f6b966a975498612117212b5373f4103c.tar.zst
PeerTube-00004f7f6b966a975498612117212b5373f4103c.zip
Put admin users in overview tab
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-password.component.ts')
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts55
1 files changed, 0 insertions, 55 deletions
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
deleted file mode 100644
index 42bf20de1..000000000
--- a/client/src/app/+admin/users/user-edit/user-password.component.ts
+++ /dev/null
@@ -1,55 +0,0 @@
1import { Component, Input, OnInit } from '@angular/core'
2import { Notifier, UserService } from '@app/core'
3import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { UserUpdate } from '@shared/models'
6
7@Component({
8 selector: 'my-user-password',
9 templateUrl: './user-password.component.html',
10 styleUrls: [ './user-password.component.scss' ]
11})
12export class UserPasswordComponent extends FormReactive implements OnInit {
13 error: string
14 username: string
15 showPassword = false
16
17 @Input() userId: number
18
19 constructor (
20 protected formValidatorService: FormValidatorService,
21 private notifier: Notifier,
22 private userService: UserService
23 ) {
24 super()
25 }
26
27 ngOnInit () {
28 this.buildForm({
29 password: USER_PASSWORD_VALIDATOR
30 })
31 }
32
33 formValidated () {
34 this.error = undefined
35
36 const userUpdate: UserUpdate = this.form.value
37
38 this.userService.updateUser(this.userId, userUpdate)
39 .subscribe({
40 next: () => this.notifier.success($localize`Password changed for user ${this.username}.`),
41
42 error: err => {
43 this.error = err.message
44 }
45 })
46 }
47
48 togglePasswordVisibility () {
49 this.showPassword = !this.showPassword
50 }
51
52 getFormButtonTitle () {
53 return $localize`Update user password`
54 }
55}