- Fix trigger setup to… work…
- Make sure new manual builds are added to the repo build list immediately
This commit is contained in:
parent
0a9ee6c49f
commit
63cf8beb26
3 changed files with 28 additions and 9 deletions
|
@ -8,7 +8,10 @@
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
<h4 class="modal-title">Setup new build trigger</h4>
|
<h4 class="modal-title">Setup new build trigger</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body" ng-show="activating">
|
||||||
|
<span class="quay-spinner"></span> Setting up trigger...
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" ng-show="!activating">
|
||||||
<!-- Trigger-specific setup -->
|
<!-- Trigger-specific setup -->
|
||||||
<div class="trigger-description-element trigger-option-section" ng-switch on="trigger.service">
|
<div class="trigger-description-element trigger-option-section" ng-switch on="trigger.service">
|
||||||
<div ng-switch-when="github">
|
<div ng-switch-when="github">
|
||||||
|
@ -90,8 +93,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-primary"
|
<button type="button" class="btn btn-primary"
|
||||||
ng-disabled="!trigger.$ready || (!publicPull && !pullEntity) || checkingPullRequirements"
|
ng-disabled="!trigger.$ready || (!publicPull && !pullEntity) || checkingPullRequirements || activating"
|
||||||
ng-click="activate">Finished</button>
|
ng-click="activate()">Finished</button>
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
|
|
|
@ -3722,17 +3722,26 @@ quayApp.directive('setupTriggerDialog', function () {
|
||||||
'activated': '&activated'
|
'activated': '&activated'
|
||||||
},
|
},
|
||||||
controller: function($scope, $element, ApiService, UserService) {
|
controller: function($scope, $element, ApiService, UserService) {
|
||||||
|
var modalSetup = false;
|
||||||
|
|
||||||
$scope.show = function() {
|
$scope.show = function() {
|
||||||
|
$scope.activating = false;
|
||||||
$scope.pullEntity = null;
|
$scope.pullEntity = null;
|
||||||
$scope.publicPull = true;
|
$scope.publicPull = true;
|
||||||
$scope.showPullRequirements = false;
|
$scope.showPullRequirements = false;
|
||||||
|
|
||||||
$('#setupTriggerModal').modal({});
|
$('#setupTriggerModal').modal({});
|
||||||
|
|
||||||
|
if (!modalSetup) {
|
||||||
$('#setupTriggerModal').on('hidden.bs.modal', function () {
|
$('#setupTriggerModal').on('hidden.bs.modal', function () {
|
||||||
|
if ($scope.trigger['is_active']) { return; }
|
||||||
|
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.cancelSetupTrigger();
|
$scope.cancelSetupTrigger();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
modalSetup = true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.isNamespaceAdmin = function(namespace) {
|
$scope.isNamespaceAdmin = function(namespace) {
|
||||||
|
@ -3744,6 +3753,7 @@ quayApp.directive('setupTriggerDialog', function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.hide = function() {
|
$scope.hide = function() {
|
||||||
|
$scope.activating = false;
|
||||||
$('#setupTriggerModal').modal('hide');
|
$('#setupTriggerModal').modal('hide');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3810,9 +3820,12 @@ quayApp.directive('setupTriggerDialog', function () {
|
||||||
data['pull_robot'] = $scope.pullEntity['name'];
|
data['pull_robot'] = $scope.pullEntity['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.activating = true;
|
||||||
|
|
||||||
ApiService.activateBuildTrigger(data, params).then(function(resp) {
|
ApiService.activateBuildTrigger(data, params).then(function(resp) {
|
||||||
trigger['is_active'] = true;
|
$scope.hide();
|
||||||
trigger['pull_robot'] = resp['pull_robot'];
|
$scope.trigger['is_active'] = true;
|
||||||
|
$scope.trigger['pull_robot'] = resp['pull_robot'];
|
||||||
$scope.activated({'trigger': $scope.trigger});
|
$scope.activated({'trigger': $scope.trigger});
|
||||||
}, function(resp) {
|
}, function(resp) {
|
||||||
$scope.hide();
|
$scope.hide();
|
||||||
|
|
|
@ -362,6 +362,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.handleBuildStarted = function(build) {
|
$scope.handleBuildStarted = function(build) {
|
||||||
|
getBuildInfo($scope.repo);
|
||||||
startBuildInfoTimer($scope.repo);
|
startBuildInfoTimer($scope.repo);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1518,6 +1519,8 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.deleteTrigger = function(trigger) {
|
$scope.deleteTrigger = function(trigger) {
|
||||||
|
if (!trigger) { return; }
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
'repository': namespace + '/' + name,
|
'repository': namespace + '/' + name,
|
||||||
'trigger_uuid': trigger.id
|
'trigger_uuid': trigger.id
|
||||||
|
|
Reference in a new issue