diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-10-08 21:05:57 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-11 09:26:39 +0100 |
commit | 2c2baef6f30625794cf1f4f72c184527a4d82562 (patch) | |
tree | 489a20552219dac7ff683612b98dca9d20a2fd3b | |
parent | a3342ce250936c30dc6df7563f4e984c172f61c1 (diff) | |
download | PeerTube-2c2baef6f30625794cf1f4f72c184527a4d82562.tar.gz PeerTube-2c2baef6f30625794cf1f4f72c184527a4d82562.tar.zst PeerTube-2c2baef6f30625794cf1f4f72c184527a4d82562.zip |
move user-password to Input decorator
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-edit.component.html | 2 | ||||
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-password.component.ts | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.html b/client/src/app/+admin/users/user-edit/user-edit.component.html index b06c91ff3..6944ec435 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.component.html +++ b/client/src/app/+admin/users/user-edit/user-edit.component.html | |||
@@ -88,4 +88,4 @@ | |||
88 | <button (click)="resetPassword()" i18n>Ask for new password</button> | 88 | <button (click)="resetPassword()" i18n>Ask for new password</button> |
89 | 89 | ||
90 | <p class="mt-4" i18n>Manually set the user password</p> | 90 | <p class="mt-4" i18n>Manually set the user password</p> |
91 | <my-user-password></my-user-password> | 91 | <my-user-password userId="userId"></my-user-password> |
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 1f9ccb4e8..99c4c8a59 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 | |||
@@ -19,10 +19,11 @@ import { FormReactive } from '../../../shared' | |||
19 | }) | 19 | }) |
20 | export class UserPasswordComponent extends FormReactive implements OnInit, OnDestroy { | 20 | export class UserPasswordComponent extends FormReactive implements OnInit, OnDestroy { |
21 | error: string | 21 | error: string |
22 | userId: number | ||
23 | username: string | 22 | username: string |
24 | showPassword = false | 23 | showPassword = false |
25 | 24 | ||
25 | @Input() userId: number | ||
26 | |||
26 | private paramsSub: Subscription | 27 | private paramsSub: Subscription |
27 | 28 | ||
28 | constructor ( | 29 | constructor ( |
@@ -43,15 +44,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit, OnDes | |||
43 | this.buildForm({ | 44 | this.buildForm({ |
44 | password: this.userValidatorsService.USER_PASSWORD | 45 | password: this.userValidatorsService.USER_PASSWORD |
45 | }) | 46 | }) |
46 | |||
47 | this.paramsSub = this.route.params.subscribe(routeParams => { | ||
48 | const userId = routeParams['id'] | ||
49 | this.userService.getUser(userId).subscribe( | ||
50 | user => this.onUserFetched(user), | ||
51 | |||
52 | err => this.error = err.message | ||
53 | ) | ||
54 | }) | ||
55 | } | 47 | } |
56 | 48 | ||
57 | ngOnDestroy () { | 49 | ngOnDestroy () { |