From 11f483419e1016b5c2ac61da5687b60c0885c5d3 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Mon, 5 Jul 2021 20:15:58 -0600 Subject: [PATCH] Add logged in user profile icon and name on sidebar --- .../settings/settings.component.spec.ts | 1 + src/main/webapp/app/core/auth/account.model.ts | 1 + .../app/core/auth/account.service.spec.ts | 1 + .../webapp/app/home/home.component.spec.ts | 1 + .../app/layouts/sidebar/sidebar.component.html | 4 ++-- .../app/layouts/sidebar/sidebar.component.ts | 18 ++++++++++++++++-- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/app/account/settings/settings.component.spec.ts b/src/main/webapp/app/account/settings/settings.component.spec.ts index 257e405..7d9fc6b 100644 --- a/src/main/webapp/app/account/settings/settings.component.spec.ts +++ b/src/main/webapp/app/account/settings/settings.component.spec.ts @@ -18,6 +18,7 @@ describe('Component Tests', () => { let fixture: ComponentFixture; let mockAccountService: AccountService; const account: Account = { + id: 0, firstName: 'John', lastName: 'Doe', activated: true, diff --git a/src/main/webapp/app/core/auth/account.model.ts b/src/main/webapp/app/core/auth/account.model.ts index 22e083c..5fb0c74 100644 --- a/src/main/webapp/app/core/auth/account.model.ts +++ b/src/main/webapp/app/core/auth/account.model.ts @@ -1,5 +1,6 @@ export class Account { constructor( + public id: number, public activated: boolean, public authorities: string[], public email: string, diff --git a/src/main/webapp/app/core/auth/account.service.spec.ts b/src/main/webapp/app/core/auth/account.service.spec.ts index aec7c97..03842cc 100644 --- a/src/main/webapp/app/core/auth/account.service.spec.ts +++ b/src/main/webapp/app/core/auth/account.service.spec.ts @@ -19,6 +19,7 @@ import { AccountService } from './account.service'; function accountWithAuthorities(authorities: string[]): Account { return { + id: 0, activated: true, authorities, email: '', diff --git a/src/main/webapp/app/home/home.component.spec.ts b/src/main/webapp/app/home/home.component.spec.ts index 7d3229c..8b6a450 100644 --- a/src/main/webapp/app/home/home.component.spec.ts +++ b/src/main/webapp/app/home/home.component.spec.ts @@ -17,6 +17,7 @@ describe('Component Tests', () => { let mockAccountService: AccountService; let mockRouter: Router; const account: Account = { + id: 0, activated: true, authorities: [], email: '', diff --git a/src/main/webapp/app/layouts/sidebar/sidebar.component.html b/src/main/webapp/app/layouts/sidebar/sidebar.component.html index 98c662b..9bd3d74 100644 --- a/src/main/webapp/app/layouts/sidebar/sidebar.component.html +++ b/src/main/webapp/app/layouts/sidebar/sidebar.component.html @@ -9,12 +9,12 @@