File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/components/TeamManagement Expand file tree Collapse file tree 1 file changed +3
-1
lines changed 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 >
You can’t perform that action at this time.
0 commit comments