|
@@ -28,6 +28,7 @@ const TeamRow = createReactClass({
|
|
|
team: PropTypes.object.isRequired,
|
|
|
access: PropTypes.object.isRequired,
|
|
|
onRemove: PropTypes.func.isRequired,
|
|
|
+ teamCount: PropTypes.number.isRequired,
|
|
|
},
|
|
|
|
|
|
mixins: [ApiMixin],
|
|
@@ -79,7 +80,15 @@ const TeamRow = createReactClass({
|
|
|
{this.props.access.has('project:write') && (
|
|
|
<Box pl={2}>
|
|
|
<Confirm
|
|
|
- message={t('Are you sure you want to remove this team?')}
|
|
|
+ message={
|
|
|
+ this.props.teamCount === 1
|
|
|
+ ? t(
|
|
|
+ 'This is the last team with access to this project. Removing it will mean ' +
|
|
|
+ 'only owners and managers will be able to access the project pages. Are ' +
|
|
|
+ 'you sure you want to remove this team?'
|
|
|
+ )
|
|
|
+ : t('Are you sure you want to remove this team?')
|
|
|
+ }
|
|
|
onConfirm={this.handleRemove}
|
|
|
disabled={this.state.loading}
|
|
|
>
|
|
@@ -166,6 +175,7 @@ class ProjectTeams extends AsyncView {
|
|
|
projectId={projectId}
|
|
|
team={team}
|
|
|
onRemove={this.handleRemovedTeam.bind(this, team)}
|
|
|
+ teamCount={this.state.projectTeams.length}
|
|
|
/>
|
|
|
);
|
|
|
})}
|