- Add a build trigger link to the builds menu in the repo view

- Have the dialog dismiss auto-delete the trigger
- Have the github trigger setup choose the first directory, if any
This commit is contained in:
Joseph Schorr 2014-02-25 15:25:24 -05:00
parent bc26029951
commit c3c26ba199
4 changed files with 20 additions and 2 deletions

View file

@ -2744,7 +2744,13 @@ quayApp.directive('triggerSetupGithub', function () {
$scope.locationError = null;
$scope.locations = resp['subdir'] || [];
$scope.trigger.$ready = true;
$scope.isInvalidLocation = resp['subdir'].indexOf('') < 0;
if ($scope.locations.length > 0) {
$scope.setLocation($scope.locations[0]);
} else {
$scope.currentLocation = null;
$scope.isInvalidLocation = resp['subdir'].indexOf('') < 0;
}
}, function(resp) {
$scope.locationError = resp['message'] || 'Could not load Dockerfile locations';
$scope.locations = null;

View file

@ -1430,6 +1430,11 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
$scope.triggerSetupReady = false;
$scope.currentSetupTrigger = trigger;
$('#setupTriggerModal').modal({});
$('#setupTriggerModal').on('hidden.bs.modal', function () {
$scope.$apply(function() {
$scope.cancelSetupTrigger();
});
});
};
$scope.finishSetupTrigger = function(trigger) {
@ -1458,6 +1463,8 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
};
$scope.cancelSetupTrigger = function() {
if (!$scope.currentSetupTrigger) { return; }
$('#setupTriggerModal').modal('hide');
$scope.deleteTrigger($scope.currentSetupTrigger);
$scope.currentSetupTrigger = null;