From 32a7cd68f4c4c8d526d6316435a0234825834e64 Mon Sep 17 00:00:00 2001 From: bnymncoskuner Date: Thu, 1 Apr 2021 10:34:29 +0300 Subject: [PATCH] fix: show tenant name next to the username --- .../nav-items/current-user.component.html | 41 +++++++++++++++++ .../nav-items/current-user.component.ts | 44 ++----------------- 2 files changed, 45 insertions(+), 40 deletions(-) create mode 100644 npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.html diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.html new file mode 100644 index 0000000000..ccf65694f8 --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.html @@ -0,0 +1,41 @@ + + {{ + 'AbpAccount::Login' | abpLocalization + }} + + diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts index 922ccdba39..aa2a144be6 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts @@ -3,55 +3,18 @@ import { ConfigStateService, CurrentUserDto, NAVIGATE_TO_MANAGE_PROFILE, + SessionStateService, } from '@abp/ng.core'; import { Component, Inject } from '@angular/core'; import { Observable } from 'rxjs'; @Component({ selector: 'abp-current-user', - // tslint:disable-next-line: component-max-inline-declarations - template: ` - - {{ - 'AbpAccount::Login' | abpLocalization - }} - - - `, + templateUrl: './current-user.component.html', }) export class CurrentUserComponent { currentUser$: Observable = this.configState.getOne$('currentUser'); + selectedTenant$ = this.sessionState.getTenant$(); get smallScreen(): boolean { return window.innerWidth < 992; @@ -61,6 +24,7 @@ export class CurrentUserComponent { @Inject(NAVIGATE_TO_MANAGE_PROFILE) public navigateToManageProfile, private authService: AuthService, private configState: ConfigStateService, + private sessionState: SessionStateService, ) {} navigateToLogin() {