Add basic user interface for application repos

Adds support for creating app repos, viewing app repos and seeing the list of app repos in the Quay UI.
This commit is contained in:
Joseph Schorr 2017-03-23 17:16:19 -04:00
parent 3dd6e6919d
commit f9e6110f73
47 changed files with 1009 additions and 106 deletions

View file

@ -15,6 +15,10 @@ angular.module('quay').directive('repoPanelSettings', function () {
controller: function($scope, $element, ApiService, Config) {
$scope.deleteDialogCounter = 0;
var getTitle = function(repo) {
return repo.kind == 'application' ? 'application' : 'image';
};
$scope.getBadgeFormat = function(format, repository) {
if (!repository) { return ''; }
@ -52,7 +56,8 @@ angular.module('quay').directive('repoPanelSettings', function () {
'repository': $scope.repository.namespace + '/' + $scope.repository.name
};
var errorHandler = ApiService.errorDisplay('Could not delete repository', callback);
var errorHandler = ApiService.errorDisplay(
'Could not delete ' + getTitle($scope.repository), callback);
ApiService.deleteRepository(null, params).then(function() {
callback(true);
@ -62,9 +67,11 @@ angular.module('quay').directive('repoPanelSettings', function () {
}, errorHandler);
};
$scope.askChangeAccess = function(newAccess) {
bootbox.confirm('Are you sure you want to make this repository ' + newAccess + '?', function(r) {
var msg = 'Are you sure you want to make this ' + getTitle($scope.repository) + ' ' +
newAccess + '?';
bootbox.confirm(msg, function(r) {
if (!r) { return; }
$scope.changeAccess(newAccess);
});
@ -81,7 +88,7 @@ angular.module('quay').directive('repoPanelSettings', function () {
ApiService.changeRepoVisibility(visibility, params).then(function() {
$scope.repository.is_public = newAccess == 'public';
}, ApiService.errorDisplay('Could not change repository visibility'));
}, ApiService.errorDisplay('Could not change visibility'));
};
}
};