Add check for existing repo with the same name
This commit is contained in:
parent
834cb28d30
commit
c3b10c12bb
4 changed files with 24 additions and 6 deletions
|
@ -953,7 +953,7 @@ function V1Ctrl($scope, $location, UserService) {
|
|||
}, true);
|
||||
}
|
||||
|
||||
function NewRepoCtrl($scope, $location, $http, UserService, Restangular, PlanService) {
|
||||
function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangular, PlanService) {
|
||||
$scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) {
|
||||
$scope.user = currentUser;
|
||||
}, true);
|
||||
|
@ -1069,6 +1069,8 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular, PlanSer
|
|||
};
|
||||
|
||||
$scope.createNewRepo = function() {
|
||||
$('#repoName').popover('hide');
|
||||
|
||||
var uploader = $('#file-drop')[0];
|
||||
if ($scope.repo.initialize && uploader.files.length < 1) {
|
||||
$('#missingfileModal').modal();
|
||||
|
@ -1096,9 +1098,12 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular, PlanSer
|
|||
|
||||
// Otherwise, redirect to the repo page.
|
||||
$location.path('/repository/' + created.namespace + '/' + created.name);
|
||||
}, function() {
|
||||
$('#cannotcreateModal').modal();
|
||||
}, function(result) {
|
||||
$scope.creating = false;
|
||||
$scope.createError = result.data;
|
||||
$timeout(function() {
|
||||
$('#repoName').popover('show');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue