Add messaging when trying to create a team that already exists
Fixes https://jira.coreos.com/browse/QUAY-827
This commit is contained in:
parent
33b7ca0eaa
commit
72ca758c88
4 changed files with 16 additions and 4 deletions
|
@ -35,6 +35,11 @@ angular.module('quay').directive('createTeamDialog', function () {
|
|||
});
|
||||
|
||||
ApiService.updateOrganizationTeam(data, params).then(function(resp) {
|
||||
if (!resp.new_team) {
|
||||
callback(null);
|
||||
bootbox.alert('Team with name "' + resp.name + '" already exists')
|
||||
return;
|
||||
}
|
||||
callback(resp);
|
||||
}, errorDisplay);
|
||||
};
|
||||
|
|
|
@ -151,7 +151,9 @@ angular.module('quay').directive('entitySearch', function () {
|
|||
|
||||
$scope.handleTeamCreated = function(created) {
|
||||
$scope.setEntity(created.name, 'team', false, created.avatar);
|
||||
$scope.teams.push(created);
|
||||
if (created.new_team) {
|
||||
$scope.teams.push(created);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.handleRobotCreated = function(created) {
|
||||
|
|
|
@ -101,6 +101,10 @@ angular.module('quay').directive('teamsManager', function () {
|
|||
};
|
||||
|
||||
$scope.handleTeamCreated = function(created) {
|
||||
if (!created.new_team) {
|
||||
return;
|
||||
}
|
||||
|
||||
var teamname = created.name;
|
||||
created['member_count'] = 0;
|
||||
|
||||
|
|
Reference in a new issue