- Fix trigger setup to… work…

- Make sure new manual builds are added to the repo build list immediately
This commit is contained in:
Joseph Schorr 2014-04-16 17:50:25 -04:00
parent 0a9ee6c49f
commit 63cf8beb26
3 changed files with 28 additions and 9 deletions

View file

@ -3722,17 +3722,26 @@ quayApp.directive('setupTriggerDialog', function () {
'activated': '&activated'
},
controller: function($scope, $element, ApiService, UserService) {
var modalSetup = false;
$scope.show = function() {
$scope.activating = false;
$scope.pullEntity = null;
$scope.publicPull = true;
$scope.showPullRequirements = false;
$('#setupTriggerModal').modal({});
$('#setupTriggerModal').on('hidden.bs.modal', function () {
$scope.$apply(function() {
$scope.cancelSetupTrigger();
if (!modalSetup) {
$('#setupTriggerModal').on('hidden.bs.modal', function () {
if ($scope.trigger['is_active']) { return; }
$scope.$apply(function() {
$scope.cancelSetupTrigger();
});
});
});
modalSetup = true;
}
};
$scope.isNamespaceAdmin = function(namespace) {
@ -3744,6 +3753,7 @@ quayApp.directive('setupTriggerDialog', function () {
};
$scope.hide = function() {
$scope.activating = false;
$('#setupTriggerModal').modal('hide');
};
@ -3810,9 +3820,12 @@ quayApp.directive('setupTriggerDialog', function () {
data['pull_robot'] = $scope.pullEntity['name'];
}
$scope.activating = true;
ApiService.activateBuildTrigger(data, params).then(function(resp) {
trigger['is_active'] = true;
trigger['pull_robot'] = resp['pull_robot'];
$scope.hide();
$scope.trigger['is_active'] = true;
$scope.trigger['pull_robot'] = resp['pull_robot'];
$scope.activated({'trigger': $scope.trigger});
}, function(resp) {
$scope.hide();