summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/user.ts
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-12-10 18:55:03 +0200
committerTal Gitelman <tg851x@intl.att.com>2017-12-10 19:33:38 +0200
commit51d50f0ef642e0f996a1c8b8d2ef4838bdfec892 (patch)
tree3ac236a864d74d19b0f5c9020891a7a7e5c31b44 /catalog-ui/src/app/models/user.ts
parentb5cc2e0695f195716d6ccdc65e73807a6632ec70 (diff)
Final commit to master merge from
Change-Id: Ib464f9a8828437c86fe6def8af238aaf83473507 Issue-ID: SDC-714 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/models/user.ts')
-rw-r--r--catalog-ui/src/app/models/user.ts29
1 files changed, 14 insertions, 15 deletions
diff --git a/catalog-ui/src/app/models/user.ts b/catalog-ui/src/app/models/user.ts
index 54ddf1e5f6..0fb5364290 100644
--- a/catalog-ui/src/app/models/user.ts
+++ b/catalog-ui/src/app/models/user.ts
@@ -19,7 +19,6 @@
*/
'use strict';
-import {IUserResource} from "../services/user-resource-service";
export enum UserRole {
ADMIN,
@@ -46,7 +45,7 @@ export interface IUserProperties extends IUserManager {
}
export interface IUser {
- resource:IUserResource;
+ userInfo:IUserProperties;
getRole():UserRole;
getRoleToView():string;
getName():string;
@@ -56,32 +55,32 @@ export interface IUser {
export class User implements IUser {
- constructor(public resource:IUserResource) {
+ constructor(public userInfo:IUserProperties) {
}
public getLastName = () => {
- return this.resource.lastName;
- }
+ return this.userInfo.lastName;
+ };
public getFirstName = () => {
- return this.resource.firstName;
- }
+ return this.userInfo.firstName;
+ };
public getName = () => {
- return this.resource.firstName + ' ' + this.resource.lastName;
- }
+ return this.userInfo.firstName + ' ' + this.userInfo.lastName;
+ };
public getLastLogin = () => {
- if (!this.resource.lastLoginTime || this.resource.lastLoginTime === "0") {
+ if (!this.userInfo.lastLoginTime || this.userInfo.lastLoginTime === "0") {
return "";
} else {
- return this.resource.lastLoginTime;
+ return this.userInfo.lastLoginTime;
}
- }
+ };
public getRole = ():UserRole => {
let role:UserRole;
- switch (UserRole[this.resource.role.toUpperCase()]) {
+ switch (UserRole[this.userInfo.role.toUpperCase()]) {
case UserRole.ADMIN:
role = UserRole.ADMIN;
break;
@@ -99,10 +98,10 @@ export class User implements IUser {
break;
}
return role;
- }
+ };
public getRoleToView = ():string => {
- let role:string = this.resource.role.toLowerCase().replace('governor', 'governance_Rep');
+ let role:string = this.userInfo.role.toLowerCase().replace('governor', 'governance_Rep');
return role.charAt(0).toUpperCase() + role.slice(1).replace('_', ' ');
}
}