summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/user-header-details
diff options
context:
space:
mode:
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'];