move user-password to Input decorator
This commit is contained in:
parent
a3342ce250
commit
2c2baef6f3
|
@ -88,4 +88,4 @@
|
|||
<button (click)="resetPassword()" i18n>Ask for new password</button>
|
||||
|
||||
<p class="mt-4" i18n>Manually set the user password</p>
|
||||
<my-user-password></my-user-password>
|
||||
<my-user-password userId="userId"></my-user-password>
|
||||
|
|
|
@ -19,10 +19,11 @@ import { FormReactive } from '../../../shared'
|
|||
})
|
||||
export class UserPasswordComponent extends FormReactive implements OnInit, OnDestroy {
|
||||
error: string
|
||||
userId: number
|
||||
username: string
|
||||
showPassword = false
|
||||
|
||||
@Input() userId: number
|
||||
|
||||
private paramsSub: Subscription
|
||||
|
||||
constructor (
|
||||
|
@ -43,15 +44,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit, OnDes
|
|||
this.buildForm({
|
||||
password: this.userValidatorsService.USER_PASSWORD
|
||||
})
|
||||
|
||||
this.paramsSub = this.route.params.subscribe(routeParams => {
|
||||
const userId = routeParams['id']
|
||||
this.userService.getUser(userId).subscribe(
|
||||
user => this.onUserFetched(user),
|
||||
|
||||
err => this.error = err.message
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
ngOnDestroy () {
|
||||
|
|
Loading…
Reference in New Issue