Redo the UI for the run trigger dialog to be much cleaner

Fixes #774
This commit is contained in:
Joseph Schorr 2016-09-29 15:19:21 +02:00
parent edc2bc8b93
commit e85a1bce0a
13 changed files with 541 additions and 369 deletions

View file

@ -27,37 +27,26 @@
$scope.repo.namespace = namespace;
};
$scope.handleBuildStarted = function() {
var repo = $scope.repo;
$location.path('/repository/' + repo.namespace + '/' + repo.name);
};
$scope.handleBuildFailed = function(message) {
var repo = $scope.repo;
bootbox.dialog({
"message": message,
"title": "Could not start Dockerfile build",
"buttons": {
"close": {
"label": "Close",
"className": "btn-primary",
"callback": function() {
$scope.$apply(function() {
$location.path('/repository/' + repo.namespace + '/' + repo.name);
});
}
}
}
});
return true;
};
$scope.$watch('repo.name', function() {
$scope.createError = null;
});
$scope.startBuild = function() {
$scope.buildStarting = true;
$scope.startBuildCallback(function(status, messageOrBuild) {
if (status) {
$location.url('/repository/' + $scope.created.namespace + '/' + $scope.created.name +
'?tab=builds');
} else {
bootbox.alert(messageOrBuild || 'Could not start build');
}
});
};
$scope.readyForBuild = function(startBuild) {
$scope.startBuildCallback = startBuild;
};
$scope.createNewRepo = function() {
$scope.creating = true;
var repo = $scope.repo;
@ -72,9 +61,10 @@
$scope.creating = false;
$scope.created = created;
// Start the upload process if applicable.
// Start the build if applicable.
if ($scope.repo.initialize == 'dockerfile' || $scope.repo.initialize == 'zipfile') {
$scope.createdForBuild = created;
$scope.startBuild();
return;
}