From c3c26ba1993ffeda9687adc139f3abcb1fec9339 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 25 Feb 2014 15:25:24 -0500 Subject: [PATCH] - 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 --- static/js/app.js | 8 +++++++- static/js/controllers.js | 7 +++++++ static/partials/repo-admin.html | 2 +- static/partials/view-repo.html | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index ef67850ea..7ec770f13 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -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; diff --git a/static/js/controllers.js b/static/js/controllers.js index b398838a8..22dd24d06 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -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; diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html index edc2d1ebe..58e9618b5 100644 --- a/static/partials/repo-admin.html +++ b/static/partials/repo-admin.html @@ -359,7 +359,7 @@ diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index e3b8ef3f8..20d393de0 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -32,6 +32,11 @@ New Dockerfile Build +
  • + + Build Triggers + +