From 72a3336e14b4e883648c4422ebb3aa61a5eb8300 Mon Sep 17 00:00:00 2001 From: Art Date: Tue, 21 Sep 2021 18:55:48 +0300 Subject: [PATCH] 171. Open edit model logic (#23 Section 24: User Page - Edit User) --- .../app/component/user/user.component.html | 101 ++++++++++++++++-- .../src/app/component/user/user.component.ts | 8 ++ 2 files changed, 99 insertions(+), 10 deletions(-) diff --git a/support-portal-frontend/src/app/component/user/user.component.html b/support-portal-frontend/src/app/component/user/user.component.html index 054af39..15d4cde 100644 --- a/support-portal-frontend/src/app/component/user/user.component.html +++ b/support-portal-frontend/src/app/component/user/user.component.html @@ -67,23 +67,23 @@ - - + + - {{appUser?.userId}} - {{appUser?.firstName}} - {{appUser?.lastName}} - {{appUser?.username}} - {{appUser?.email}} - + {{appUser?.userId}} + {{appUser?.firstName}} + {{appUser?.lastName}} + {{appUser?.username}} + {{appUser?.email}} + Active Inactive
- +
@@ -94,7 +94,7 @@ - @@ -258,6 +258,87 @@ + + diff --git a/support-portal-frontend/src/app/component/user/user.component.ts b/support-portal-frontend/src/app/component/user/user.component.ts index 91a43e0..c6ce48b 100644 --- a/support-portal-frontend/src/app/component/user/user.component.ts +++ b/support-portal-frontend/src/app/component/user/user.component.ts @@ -23,6 +23,8 @@ export class UserComponent implements OnInit, OnDestroy { public selectedUser: User; public profileImageFileName: string | null; public profileImage: File | null; + public editUser: User = new User(); + private currentUsername: string; constructor(private userService: UserService, private notificationService: NotificationService) { @@ -128,4 +130,10 @@ export class UserComponent implements OnInit, OnDestroy { private clickButton(buttonId: string): void { document.getElementById(buttonId)?.click(); } + + public onEditUser(user: User): void { + this.editUser = user; + this.currentUsername = user.username; + this.clickButton('openUserEdit'); + } }