From 1add78c64cdf588c62a6a2d35b104da76d00c5e6 Mon Sep 17 00:00:00 2001 From: Danilo Hoffmann Date: Tue, 30 Jun 2020 17:15:28 +0200 Subject: [PATCH] feat: display information for B2B users above my account navigation (#298) --- src/app/core/facades/account.facade.ts | 2 + .../account-navigation.component.html | 1 + .../account-navigation.component.spec.ts | 5 +- src/app/pages/account/account-page.module.ts | 3 +- .../account-user-info.component.html | 16 ++++ .../account-user-info.component.spec.ts | 78 +++++++++++++++++++ .../account-user-info.component.ts | 28 +++++++ .../pages/account/account-navigation.scss | 6 ++ 8 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 src/app/pages/account/account-user-info/account-user-info.component.html create mode 100644 src/app/pages/account/account-user-info/account-user-info.component.spec.ts create mode 100644 src/app/pages/account/account-user-info/account-user-info.component.ts diff --git a/src/app/core/facades/account.facade.ts b/src/app/core/facades/account.facade.ts index d046524e2d..2a7e2c9e79 100644 --- a/src/app/core/facades/account.facade.ts +++ b/src/app/core/facades/account.facade.ts @@ -17,6 +17,7 @@ import { getAllAddresses, loadAddresses, } from 'ish-core/store/customer/addresses'; +import { getUserRoles } from 'ish-core/store/customer/authorization'; import { getOrders, getOrdersLoading, getSelectedOrder, loadOrders } from 'ish-core/store/customer/orders'; import { createUser, @@ -60,6 +61,7 @@ export class AccountFacade { userError$ = this.store.pipe(select(getUserError)); userLoading$ = this.store.pipe(select(getUserLoading)); isLoggedIn$ = this.store.pipe(select(getUserAuthorized)); + roles$ = this.store.pipe(select(getUserRoles)); loginUser(credentials: Credentials) { this.store.dispatch(loginUser({ credentials })); diff --git a/src/app/pages/account/account-navigation/account-navigation.component.html b/src/app/pages/account/account-navigation/account-navigation.component.html index 399dfc894b..4f0b6f6187 100644 --- a/src/app/pages/account/account-navigation/account-navigation.component.html +++ b/src/app/pages/account/account-navigation/account-navigation.component.html @@ -1,5 +1,6 @@