Add the ability to login with a robot, use the wrench icon for robots all over the place.

This commit is contained in:
yackob03 2013-11-20 19:43:19 -05:00
parent b407c1d9fb
commit e69591c7d6
8 changed files with 46 additions and 15 deletions

View file

@ -643,8 +643,10 @@ quayApp.directive('entitySearch', function () {
},
template: function (datum) {
template = '<div class="entity-mini-listing">';
if (datum.entity.kind == 'user') {
if (datum.entity.kind == 'user' && !datum.entity.is_robot) {
template += '<i class="fa fa-user fa-lg"></i>';
} else if (datum.entity.kind == 'user' && datum.entity.is_robot) {
template += '<i class="fa fa-wrench fa-lg"></i>';
} else if (datum.entity.kind == 'team') {
template += '<i class="fa fa-group fa-lg"></i>';
}

View file

@ -527,7 +527,7 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
// Need the $scope.apply for both the permission stuff to change and for
// the XHR call to be made.
$scope.$apply(function() {
$scope.addRole(entity.name, 'read', entity.kind, entity.is_org_member)
$scope.addRole(entity.name, 'read', entity.kind);
});
};
@ -545,15 +545,14 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
});
};
$scope.addRole = function(entityName, role, kind, is_org_member) {
$scope.addRole = function(entityName, role, kind) {
var permission = {
'role': role,
'is_org_member': is_org_member
};
var permissionPost = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName));
permissionPost.customPOST(permission).then(function() {
$scope.permissions[kind][entityName] = permission;
permissionPost.customPOST(permission).then(function(result) {
$scope.permissions[kind][entityName] = result;
}, function(result) {
$('#cannotchangeModal').modal({});
});