summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/user-header-details
diff options
context:
space:
mode:
authorys9693 <ys9693@att.com>2020-01-19 13:50:02 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-01-22 12:33:31 +0000
commit16a9fce0e104a38371a9e5a567ec611ae3fc7f33 (patch)
tree03a2aff3060ddb5bc26a90115805a04becbaffc9 /catalog-ui/src/app/directives/user-header-details
parentaa83a2da4f911c3ac89318b8e9e8403b072942e1 (diff)
Catalog alignment
Issue-ID: SDC-2724 Signed-off-by: ys9693 <ys9693@att.com> Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe
Diffstat (limited to 'catalog-ui/src/app/directives/user-header-details')
-rw-r--r--catalog-ui/src/app/directives/user-header-details/user-header-details-directive.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/catalog-ui/src/app/directives/user-header-details/user-header-details-directive.ts b/catalog-ui/src/app/directives/user-header-details/user-header-details-directive.ts
index 1367906e21..0200e3d510 100644
--- a/catalog-ui/src/app/directives/user-header-details/user-header-details-directive.ts
+++ b/catalog-ui/src/app/directives/user-header-details/user-header-details-directive.ts
@@ -21,6 +21,7 @@
'use strict';
import {User, IUser, IAppConfigurtaion, IUserProperties} from "app/models";
import { UserService } from "../../ng2/services/user.service";
+import { AuthenticationService } from "app/ng2/services/authentication.service";
export interface IUserHeaderDetailsScope extends ng.IScope {
iconUrl:string;
user:IUser;
@@ -29,7 +30,7 @@ export interface IUserHeaderDetailsScope extends ng.IScope {
export class UserHeaderDetailsDirective implements ng.IDirective {
- constructor(private $http:ng.IHttpService, private sdcConfig:IAppConfigurtaion, private userService:UserService) {
+ constructor(private $http:ng.IHttpService, private sdcConfig:IAppConfigurtaion, private userService:UserService, private authService: AuthenticationService) {
}
scope = {
@@ -46,7 +47,7 @@ export class UserHeaderDetailsDirective implements ng.IDirective {
scope.initUser = ():void => {
let defaultUserId:string;
- let userInfo:IUserProperties = this.userService.getLoggedinUser();
+ let userInfo:IUserProperties = this.authService.getLoggedinUser();
if (!userInfo) {
defaultUserId = this.$http.defaults.headers.common[this.sdcConfig.cookie.userIdSuffix];
this.userService.getUser(defaultUserId).subscribe((defaultUserInfo):void => {
@@ -59,10 +60,10 @@ export class UserHeaderDetailsDirective implements ng.IDirective {
scope.initUser();
};
- public static factory = ($http:ng.IHttpService, sdcConfig:IAppConfigurtaion, userService:UserService)=> {
- return new UserHeaderDetailsDirective($http, sdcConfig, userService);
+ public static factory = ($http:ng.IHttpService, sdcConfig:IAppConfigurtaion, userService:UserService, authService:AuthenticationService)=> {
+ return new UserHeaderDetailsDirective($http, sdcConfig, userService, authService);
};
}
-UserHeaderDetailsDirective.factory.$inject = ['$http', 'sdcConfig', 'UserServiceNg2'];
+UserHeaderDetailsDirective.factory.$inject = ['$http', 'sdcConfig', 'UserServiceNg2', 'AuthenticationServiceNg2'];