Skip to content

Commit a076cbe

Browse files
committed
account manager topcoder role
1 parent b4443ff commit a076cbe

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

src/components/TeamManagement/TeamManagement.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class TeamManagement extends React.Component {
6868
const topcoderTeamManageAction = currentUser.isAdmin || (currentMember && currentUser.isManager)
6969
const topcoderTeamViewAction = !topcoderTeamManageAction
7070
const canJoinAsCopilot = !currentMember && currentUser.isCopilot
71-
const canJoinAsManager = !currentMember && currentUser.isManager
71+
const canJoinAsManager = !currentMember && (currentUser.isManager || currentUser.isAccountManager)
7272
const canShowInvite = currentMember && (currentUser.isCustomer || currentMember.isCopilot || currentMember.isManager)
7373

7474
const sortedMembers = members
@@ -157,21 +157,24 @@ class TeamManagement extends React.Component {
157157
}
158158
</div>
159159
</div>
160-
{isShowJoin && ((() => {
160+
{isShowJoin && ((() =>{
161161
const onClickCancel = () => onJoin(false)
162162
const onClickJoinConfirm = (role) => {
163163
onJoinConfirm(role)
164164
}
165+
let role = 'Manager';
166+
if (currentUser.isCopilot) role = 'Copilot';
167+
if (currentUser.isAccountManager) role = 'Account Manager';
165168
return (
166169
<Dialog
167170
disabled={processingMembers}
168171
onCancel={onClickCancel}
169172
onConfirm={onClickJoinConfirm}
170-
title={`Join project as ${currentUser.isCopilot ? 'Copilot' : 'Manager'}`}
173+
title={`Join project as ${role}`}
171174
content={JOIN_MESSAGE}
172175
buttonText="Join project"
173176
buttonColor="blue"
174-
showRoleSelector
177+
showRoleSelector={currentUser.isManager}
175178
/>
176179
)
177180
})())}

src/config/constants.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ export const EVENT_ROUTE_CHANGE = 'event.route_change'
556556
export const ROLE_TOPCODER_USER = 'Topcoder User'
557557
export const ROLE_CONNECT_COPILOT = 'Connect Copilot'
558558
export const ROLE_CONNECT_MANAGER = 'Connect Manager'
559+
export const ROLE_CONNECT_ACCOUNT_MANAGER = 'Connect Account Manager'
559560
export const ROLE_CONNECT_ADMIN = 'Connect Admin'
560561
export const ROLE_ADMINISTRATOR = 'administrator'
561562
export const ROLE_CONNECT_COPILOT_MANAGER = 'Connect Copilot Manager'
@@ -781,6 +782,9 @@ export const EVENT_TYPE = {
781782
MANAGER_JOINED: 'notifications.connect.project.member.managerJoined',
782783
COPILOT_JOINED: 'notifications.connect.project.member.copilotJoined',
783784
ASSIGNED_AS_OWNER: 'notifications.connect.project.member.assignedAsOwner',
785+
INVITE_REQUESTED: 'notifications.connect.project.member.invite.requested',
786+
INVITE_APPROVED: 'notifications.connect.project.member.copilot.added',
787+
INVITE_REFUSED: 'notifications.connect.project.member.copilot.refused',
784788
},
785789
PROJECT: {
786790
ACTIVE: 'notifications.connect.project.active',

src/projects/detail/containers/TeamManagementContainer.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ROLE_CONNECT_COPILOT,
1313
ROLE_CONNECT_COPILOT_MANAGER,
1414
ROLE_CONNECT_MANAGER,
15+
ROLE_CONNECT_ACCOUNT_MANAGER,
1516
PROJECT_ROLE_ACCOUNT_MANAGER
1617
} from '../../../config/constants'
1718
import TeamManagement from '../../../components/TeamManagement/TeamManagement'
@@ -71,7 +72,10 @@ class TeamManagementContainer extends Component {
7172

7273
onJoinConfirm(role) {
7374
const { currentUser, projectId, addProjectMember } = this.props
74-
role = role || (currentUser.isCopilot ? PROJECT_ROLE_COPILOT : PROJECT_ROLE_MANAGER)
75+
let defaultRole = PROJECT_ROLE_MANAGER;
76+
if (currentUser.isCopilot) defaultRole = PROJECT_ROLE_COPILOT;
77+
if (currentUser.isAccountManager) defaultRole = PROJECT_ROLE_ACCOUNT_MANAGER;
78+
role = role || defaultRole;
7579
addProjectMember(
7680
projectId,
7781
{userId: currentUser.userId, role}
@@ -211,6 +215,7 @@ const mapStateToProps = ({loadUser, members, projectState}) => {
211215
isManager: loadUser.user.roles.some((role) => managerRoles.indexOf(role) !== -1),
212216
isCustomer: !loadUser.user.roles.some((role) => powerUserRoles.indexOf(role) !== -1),
213217
isCopilotManager: _.indexOf(loadUser.user.roles, ROLE_CONNECT_COPILOT_MANAGER) > -1,
218+
isAccountManager: _.indexOf(loadUser.user.roles, ROLE_CONNECT_ACCOUNT_MANAGER) > -1,
214219
},
215220
allMembers: _.values(members.members),
216221
processingInvites: projectState.processingInvites,

src/projects/list/components/Projects/Projects.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import _ from 'lodash'
1515
import querystring from 'query-string'
1616
import { updateProject } from '../../../actions/project'
1717
import { getNewProjectLink } from '../../../../helpers/projectHelper'
18-
import { ROLE_CONNECT_MANAGER, ROLE_CONNECT_COPILOT, ROLE_ADMINISTRATOR,
18+
import { ROLE_CONNECT_MANAGER, ROLE_CONNECT_ACCOUNT_MANAGER, ROLE_CONNECT_COPILOT, ROLE_ADMINISTRATOR,
1919
ROLE_CONNECT_ADMIN, PROJECT_STATUS, PROJECT_STATUS_CANCELLED, PROJECT_STATUS_ACTIVE,
2020
PROJECT_LIST_DEFAULT_CRITERIA, PROJECTS_LIST_VIEW, PROJECTS_LIST_PER_PAGE } from '../../../../config/constants'
2121

@@ -262,7 +262,7 @@ class Projects extends Component {
262262

263263
const mapStateToProps = ({ projectSearch, members, loadUser, projectState, templates, notifications }) => {
264264
let isPowerUser = false
265-
const roles = [ROLE_CONNECT_COPILOT, ROLE_CONNECT_MANAGER, ROLE_ADMINISTRATOR, ROLE_CONNECT_ADMIN]
265+
const roles = [ROLE_CONNECT_COPILOT, ROLE_CONNECT_MANAGER, ROLE_CONNECT_ACCOUNT_MANAGER, ROLE_ADMINISTRATOR, ROLE_CONNECT_ADMIN]
266266
if (loadUser.user) {
267267
isPowerUser = loadUser.user.roles.some((role) => roles.indexOf(role) !== -1)
268268
}

src/routes/notifications/constants/notifications.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
import {
88
NOTIFICATION_TYPE,
9-
ROLE_CONNECT_COPILOT, ROLE_CONNECT_MANAGER, ROLE_ADMINISTRATOR,
9+
ROLE_CONNECT_COPILOT, ROLE_CONNECT_MANAGER, ROLE_CONNECT_ACCOUNT_MANAGER, ROLE_ADMINISTRATOR,
1010
PROJECT_ROLE_COPILOT, PROJECT_ROLE_MANAGER, PROJECT_ROLE_OWNER, PROJECT_ROLE_MEMBER,
1111
EVENT_TYPE,
1212
} from '../../../config/constants'
@@ -33,6 +33,11 @@ export const NOTIFICATIONS = [
3333
text: 'Your Project was created successfully',
3434
projectRoles: [PROJECT_ROLE_OWNER],
3535
goTo: GOTO.PROJECT_DASHBOARD
36+
},
37+
{
38+
text: 'New project is created',
39+
topcoderRoles: [ROLE_CONNECT_ACCOUNT_MANAGER],
40+
goTo: GOTO.PROJECT_DASHBOARD
3641
}]
3742
},
3843

@@ -59,7 +64,7 @@ export const NOTIFICATIONS = [
5964
goTo: GOTO.PROJECT_DASHBOARD
6065
}, {
6166
text: 'Project is available for review',
62-
topcoderRoles: [ROLE_CONNECT_MANAGER, ROLE_ADMINISTRATOR],
67+
topcoderRoles: [ROLE_CONNECT_MANAGER, ROLE_CONNECT_ACCOUNT_MANAGER, ROLE_ADMINISTRATOR],
6368
goTo: GOTO.PROJECT_SPECIFICATION
6469
}]
6570
},

0 commit comments

Comments
 (0)