Skip to content

Commit 58adb17

Browse files
committed
send new roles to analytics
1 parent 3bb1fb3 commit 58adb17

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/actions/loadUser.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import {
99
ROLE_CONNECT_COPILOT,
1010
ROLE_TOPCODER_USER,
1111
ROLE_CONNECT_MANAGER,
12-
ROLE_CONNECT_ADMIN
12+
ROLE_CONNECT_ADMIN,
13+
ROLE_ACCOUNT_EXECUTIVE,
14+
ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE,
15+
ROLE_PROGRAM_MANAGER,
16+
ROLE_PRESALES, ROLE_PROJECT_MANAGER, ROLE_SOLUTION_ARCHITECT
1317
} from '../config/constants'
1418
import { getFreshToken, configureConnector, decodeToken } from 'tc-accounts'
1519
import { getUserProfile } from '../api/users'
@@ -55,7 +59,19 @@ export function loadUserSuccess(dispatch, token) {
5559
currentUser = _.assign(currentUser, profile)
5660
// determine user role
5761
let userRole
58-
if (_.indexOf(currentUser.roles, ROLE_ADMINISTRATOR) > -1) {
62+
if (_.indexOf(currentUser.roles, ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE) > -1) {
63+
userRole = ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE
64+
} else if (_.indexOf(currentUser.roles, ROLE_PRESALES) > -1) {
65+
userRole = ROLE_PRESALES
66+
} else if (_.indexOf(currentUser.roles, ROLE_ACCOUNT_EXECUTIVE) > -1) {
67+
userRole = ROLE_ACCOUNT_EXECUTIVE
68+
} else if (_.indexOf(currentUser.roles, ROLE_PROGRAM_MANAGER) > -1) {
69+
userRole = ROLE_PROGRAM_MANAGER
70+
} else if (_.indexOf(currentUser.roles, ROLE_PROJECT_MANAGER) > -1) {
71+
userRole = ROLE_PROJECT_MANAGER
72+
} else if (_.indexOf(currentUser.roles, ROLE_SOLUTION_ARCHITECT) > -1) {
73+
userRole = ROLE_SOLUTION_ARCHITECT
74+
} else if (_.indexOf(currentUser.roles, ROLE_ADMINISTRATOR) > -1) {
5975
userRole = ROLE_ADMINISTRATOR
6076
} else if (_.indexOf(currentUser.roles, ROLE_CONNECT_ADMIN) > -1) {
6177
userRole = ROLE_CONNECT_ADMIN

0 commit comments

Comments
 (0)