File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed
components/TeamManagement Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ class ProjectManagementDialog extends React.Component {
183183 { i === 0 && ! canManageCopilots && < div className = "dialog-no-members" /> }
184184 </ div >
185185
186- { canInviteCopilots && (
186+ { canManageCopilots && (
187187 < div className = "input-container" >
188188 < div className = "hint" > invite more copilots</ div >
189189 < AutocompleteInputContainer
@@ -210,7 +210,7 @@ class ProjectManagementDialog extends React.Component {
210210 </ button >
211211 </ div >
212212 ) }
213- { ! canInviteCopilots && < div className = "dialog-placeholder" /> }
213+ { ! canManageCopilots && < div className = "dialog-placeholder" /> }
214214 </ div >
215215
216216 </ Modal >
Original file line number Diff line number Diff line change @@ -114,8 +114,10 @@ class TeamManagement extends React.Component {
114114 const copilotRemoveAction = hasPermission ( PERMISSIONS . REMOVE_COPILOTS )
115115 const copilotViewAction = hasPermission ( PERMISSIONS . VIEW_COPILOTS )
116116 const canRequestCopilot = hasPermission ( PERMISSIONS . REQUEST_COPILOTS )
117+ const canManageCopilots = hasPermission ( PERMISSIONS . MANAGE_COPILOTS )
117118 const copilotRequestLink = `https://topcoder.typeform.com/to/YJ7AL4p8#handle=${ currentUser . handle } &projectid=${ projectId } `
118119 const canJoinTopcoderTeam = ! currentMember && hasPermission ( PERMISSIONS . JOIN_TOPCODER_TEAM )
120+ const hasCopilot = members . some ( member => member . role === 'copilot' )
119121
120122 const sortedMembers = members
121123 let projectTeamInviteCount = 0
@@ -194,7 +196,7 @@ class TeamManagement extends React.Component {
194196 < div className = "projects-team" >
195197 < div className = "title" >
196198 < span styleName = "title-text" > Copilot</ span >
197- { ( copilotTeamManageAction || copilotRemoveAction || copilotViewAction ) &&
199+ { ( ( copilotTeamManageAction || copilotRemoveAction || copilotViewAction ) && ( canManageCopilots || hasCopilot ) ) &&
198200 < span className = "title-action" onClick = { ( ) => onShowCopilotDialog ( true ) } >
199201 { ( copilotTeamManageAction || copilotRemoveAction ) ? 'Manage' : 'View' }
200202 </ span >
Original file line number Diff line number Diff line change @@ -252,17 +252,6 @@ export const PERMISSIONS = {
252252 projectRoles : [ PROJECT_ROLE_COPILOT ] ,
253253 } ,
254254
255- INVITE_COPILOTS : {
256- meta : {
257- group : 'Project Members' ,
258- title : 'Invite Copilots' ,
259- description : 'Invite copilots to the project.' ,
260- } ,
261- topcoderRoles : [
262- ...TOPCODER_ADMINS
263- ]
264- } ,
265-
266255 MANAGE_TOPCODER_TEAM : {
267256 meta : {
268257 group : 'Project Members' ,
You can’t perform that action at this time.
0 commit comments