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

@ -13,7 +13,7 @@ angular.module('quay').directive('headerBar', function () {
scope: {
},
controller: function($rootScope, $scope, $element, $location, $timeout, hotkeys, UserService,
PlanService, ApiService, NotificationService, Config, CreateService, Features,
PlanService, ApiService, NotificationService, Config, Features,
DocumentationService, ExternalLoginService) {
$scope.externalSigninUrl = ExternalLoginService.getSingleSigninUrl();
@ -268,24 +268,36 @@ angular.module('quay').directive('headerBar', function () {
$location.url('/repository/' + context.repository.namespace + '/' + context.repository.name + '/build/' + build.id);
};
$scope.createRobot = function(context) {
$scope.handleRobotCreated = function(created, context) {
var namespace = $scope.getNamespace(context);
CreateService.askCreateRobot(namespace, function(created) {
if (UserService.isOrganization(namespace)) {
$location.url('/organization/' + namespace + '?tab=robots&showRobot=' + created.name);
} else {
$location.url('/user/' + namespace + '?tab=robots&showRobot=' + created.name);
}
});
if (UserService.isOrganization(namespace)) {
$location.url('/organization/' + namespace + '?tab=robots&showRobot=' + created.name);
} else {
$location.url('/user/' + namespace + '?tab=robots&showRobot=' + created.name);
}
};
$scope.createTeam = function(context) {
$scope.handleTeamCreated = function(created, context) {
var namespace = $scope.getNamespace(context);
$location.url('/organization/' + namespace + '/teams/' + created.name);
};
$scope.askCreateRobot = function(context) {
var namespace = $scope.getNamespace(context);
if (!namespace || !UserService.isNamespaceAdmin(namespace)) { return; }
CreateService.askCreateTeam(namespace, function(created) {
$location.url('/organization/' + namespace + '/teams/' + created.name);
});
$scope.createRobotInfo = {
'namespace': namespace
};
};
$scope.askCreateTeam = function(context) {
var namespace = $scope.getNamespace(context);
if (!namespace || !UserService.isNamespaceAdmin(namespace)) { return; }
$scope.createTeamInfo = {
'namespace': namespace
};
};
}
};