From 2c2baef6f30625794cf1f4f72c184527a4d82562 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 8 Oct 2018 21:05:57 +0200 Subject: move user-password to Input decorator --- .../src/app/+admin/users/user-edit/user-edit.component.html | 2 +- .../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 @@

Manually set the 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' }) 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 () { -- cgit v1.2.3