Skip to content

Commit 2cd725d

Browse files
authored
Merge branch 'dev' into feature/copilotWorkflow
2 parents 7dc7ee7 + da52543 commit 2cd725d

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

src/components/TeamManagement/TeamManagement.jsx

Lines changed: 6 additions & 3 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
@@ -162,16 +162,19 @@ class TeamManagement extends React.Component {
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: 1 addition & 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'

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'
@@ -72,7 +73,10 @@ class TeamManagementContainer extends Component {
7273

7374
onJoinConfirm(role) {
7475
const { currentUser, projectId, addProjectMember } = this.props
75-
role = role || (currentUser.isCopilot ? PROJECT_ROLE_COPILOT : PROJECT_ROLE_MANAGER)
76+
let defaultRole = PROJECT_ROLE_MANAGER
77+
if (currentUser.isCopilot) defaultRole = PROJECT_ROLE_COPILOT
78+
if (currentUser.isAccountManager) defaultRole = PROJECT_ROLE_ACCOUNT_MANAGER
79+
role = role || defaultRole
7680
addProjectMember(
7781
projectId,
7882
{userId: currentUser.userId, role}
@@ -218,6 +222,7 @@ const mapStateToProps = ({loadUser, members, projectState}) => {
218222
isManager: loadUser.user.roles.some((role) => managerRoles.indexOf(role) !== -1),
219223
isCustomer: !loadUser.user.roles.some((role) => powerUserRoles.indexOf(role) !== -1),
220224
isCopilotManager: _.indexOf(loadUser.user.roles, ROLE_CONNECT_COPILOT_MANAGER) > -1,
225+
isAccountManager: _.indexOf(loadUser.user.roles, ROLE_CONNECT_ACCOUNT_MANAGER) > -1,
221226
},
222227
allMembers: _.values(members.members),
223228
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, ROLE_CONNECT_COPILOT_MANAGER,
9+
ROLE_CONNECT_COPILOT, ROLE_CONNECT_MANAGER, ROLE_CONNECT_ACCOUNT_MANAGER, ROLE_CONNECT_COPILOT_MANAGER, ROLE_ADMINISTRATOR,
1010
PROJECT_ROLE_COPILOT, PROJECT_ROLE_MANAGER, PROJECT_ROLE_OWNER, PROJECT_ROLE_MEMBER,
1111
EVENT_TYPE,
1212
} from '../../../config/constants'
@@ -34,6 +34,11 @@ export const NOTIFICATIONS = [
3434
text: 'Your Project was created successfully',
3535
projectRoles: [PROJECT_ROLE_OWNER],
3636
goTo: GOTO.PROJECT_DASHBOARD
37+
},
38+
{
39+
text: 'New project is created',
40+
topcoderRoles: [ROLE_CONNECT_ACCOUNT_MANAGER],
41+
goTo: GOTO.PROJECT_DASHBOARD
3742
}]
3843
},
3944

@@ -60,7 +65,7 @@ export const NOTIFICATIONS = [
6065
goTo: GOTO.PROJECT_DASHBOARD
6166
}, {
6267
text: 'Project is available for review',
63-
topcoderRoles: [ROLE_CONNECT_MANAGER, ROLE_ADMINISTRATOR],
68+
topcoderRoles: [ROLE_CONNECT_MANAGER, ROLE_CONNECT_ACCOUNT_MANAGER, ROLE_ADMINISTRATOR],
6469
goTo: GOTO.PROJECT_SPECIFICATION
6570
}]
6671
},

0 commit comments

Comments
 (0)