New create entity dialogs (team and robot)

Fixes https://github.com/coreos-inc/design/issues/230
This commit is contained in:
Joseph Schorr 2016-05-12 17:59:49 -04:00
parent 2274d6ff84
commit 4a543be7a7
31 changed files with 687 additions and 232 deletions

View file

@ -12,8 +12,7 @@ angular.module('quay').directive('teamsManager', function () {
'organization': '=organization',
'isEnabled': '=isEnabled'
},
controller: function($scope, $element, ApiService, CreateService, $timeout, UserService) {
$scope.TEAM_PATTERN = TEAM_PATTERN;
controller: function($scope, $element, ApiService, $timeout, UserService) {
$scope.teamRoles = [
{ 'id': 'member', 'title': 'Member', 'kind': 'default' },
{ 'id': 'creator', 'title': 'Creator', 'kind': 'success' },
@ -27,6 +26,7 @@ angular.module('quay').directive('teamsManager', function () {
$scope.showingMembers = false;
$scope.fullMemberList = null;
$scope.feedback = null;
$scope.createTeamInfo = null;
var loadTeamMembers = function() {
if (!$scope.organization || !$scope.isEnabled) { return; }
@ -107,35 +107,27 @@ angular.module('quay').directive('teamsManager', function () {
}, errorHandler);
};
$scope.createTeam = function(teamname) {
if (!teamname) {
return;
}
$scope.askCreateTeam = function(teamname) {
$scope.createTeamInfo = {
'namespace': $scope.organization.name
};
};
if ($scope.organization.teams[teamname]) {
$('#team-' + teamname).removeClass('highlight');
setTimeout(function() {
$('#team-' + teamname).addClass('highlight');
}, 10);
return;
}
$scope.handleTeamCreated = function(created) {
var teamname = created.name;
$scope.organization.teams[teamname] = created;
$scope.members[teamname] = {};
$scope.members[teamname].members = [];
$scope.organization.ordered_teams.push(teamname);
$scope.orderedTeams.push(created);
var orgname = $scope.organization.name;
CreateService.createOrganizationTeam(ApiService, orgname, teamname, function(created) {
$scope.organization.teams[teamname] = created;
$scope.members[teamname] = {};
$scope.members[teamname].members = [];
$scope.organization.ordered_teams.push(teamname);
$scope.orderedTeams.push(created);
$scope.feedback = {
'kind': 'success',
'message': 'Team {team} created',
'data': {
'team': teamname
}
};
});
$scope.feedback = {
'kind': 'success',
'message': 'Team {team} created',
'data': {
'team': teamname
}
};
};
$scope.askDeleteTeam = function(teamname) {