parent
b5efc57655
commit
391d70d9ec
18 changed files with 496 additions and 224 deletions
|
@ -33,15 +33,6 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
locationListener && locationListener();
|
||||
});
|
||||
|
||||
var loadRobotPermissions = function(info) {
|
||||
var shortName = $scope.getShortenedName(info.name);
|
||||
info.loading_permissions = true;
|
||||
ApiService.getRobotPermissions($scope.organization, null, {'robot_shortname': shortName}).then(function(resp) {
|
||||
info.permissions = resp.permissions;
|
||||
info.loading_permissions = false;
|
||||
}, ApiService.errorDisplay('Could not load robot permissions'));
|
||||
};
|
||||
|
||||
$scope.filterToRobot = function(robotName) {
|
||||
if ($scope.robotFilter == robotName) {
|
||||
return;
|
||||
|
@ -56,14 +47,6 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
$scope.robotFilter = robotName;
|
||||
};
|
||||
|
||||
$scope.showPermissions = function(robotInfo) {
|
||||
robotInfo.showing_permissions = !robotInfo.showing_permissions;
|
||||
|
||||
if (robotInfo.showing_permissions) {
|
||||
loadRobotPermissions(robotInfo);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.showRobot = function(info) {
|
||||
$scope.robotDisplayInfo = {
|
||||
'name': info.name
|
||||
|
@ -126,6 +109,21 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
});
|
||||
};
|
||||
|
||||
$scope.setPermissions = function(info) {
|
||||
var namespace = $scope.organization ? $scope.organization.name : $scope.user.username;
|
||||
$scope.setRepoPermissionsInfo = {
|
||||
'namespace': namespace,
|
||||
'entityName': info.name,
|
||||
'entityKind': 'robot',
|
||||
'entityIcon': 'ci-robot'
|
||||
};
|
||||
};
|
||||
|
||||
$scope.handlePermissionsSet = function(info, repositories) {
|
||||
var index = $scope.findRobotIndexByName(info.entityName);
|
||||
$scope.robots[index]['repositories'] = repositories;
|
||||
};
|
||||
|
||||
$scope.robotCreated = function() {
|
||||
update();
|
||||
};
|
||||
|
|
Reference in a new issue