From c8d22c6b3748c9c7bbfe6dd67582c6336483a049 Mon Sep 17 00:00:00 2001 From: Art Date: Wed, 22 Sep 2021 12:06:57 +0300 Subject: [PATCH] 178. User profile template (#26 Section 27: User Page - Profile) --- .../app/component/user/user.component.html | 184 +++++++++++++++++- .../src/app/component/user/user.component.ts | 16 +- 2 files changed, 191 insertions(+), 9 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 a5bf681..8c23655 100644 --- a/support-portal-frontend/src/app/component/user/user.component.html +++ b/support-portal-frontend/src/app/component/user/user.component.html @@ -22,8 +22,9 @@ Settings - - Welcome, You ugly animal + + Welcome, {{loggedInUser.firstName}} {{loggedInUser.lastName}} @@ -37,9 +38,10 @@
-
- + +
- +
@@ -117,6 +120,169 @@
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
50% +
+
+
+
+
+
+

{{loggedInUser?.firstName}} {{loggedInUser?.lastName}}

+

{{loggedInUser?.username}}

+
Last + login: + {{loggedInUser?.lastLoginDateDisplay | date:'medium'}}
+
+ +
+
+
+
Joined {{loggedInUser?.joinDate | date:'mediumDate'}} +
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ (read only) + +
+
+
+
+
+
+
+
Account Settings
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
Permissions From Role
+
{{authority}}
+
+
+
+
+
+
+
+
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 7f97d52..3413261 100644 --- a/support-portal-frontend/src/app/component/user/user.component.ts +++ b/support-portal-frontend/src/app/component/user/user.component.ts @@ -7,6 +7,7 @@ import {NotificationType} from "../../notification/notification-type"; import {HttpErrorResponse} from "@angular/common/http"; import {NgForm} from "@angular/forms"; import {CustomHttpResponse} from "../../dto/custom-http-response"; +import {AuthenticationService} from "../../service/authentication.service"; @Component({ selector: 'app-user', @@ -19,6 +20,9 @@ export class UserComponent implements OnInit, OnDestroy { public titleAction$ = this.titleSubject.asObservable(); public users: User[] = []; + + public loggedInUser: User; + public refreshing: boolean; private subscriptions: Subscription[] = []; public selectedUser: User; @@ -28,11 +32,13 @@ export class UserComponent implements OnInit, OnDestroy { private currentUsername: string; constructor(private userService: UserService, - private notificationService: NotificationService) { + private notificationService: NotificationService, + private authenticationService: AuthenticationService) { } ngOnInit(): void { this.getUsers(true); + this.loggedInUser = this.authenticationService.getUserFromLocalStorage(); } ngOnDestroy(): void { @@ -193,4 +199,12 @@ export class UserComponent implements OnInit, OnDestroy { ); this.subscriptions.push(subscription); } + + onUpdateCurrentUser(profileUserForm: any) { + + } + + onLogOut() { + + } }