Merge pull request #130 from coreos-inc/setupbuildnow

Add button for running a newly setup trigger
This commit is contained in:
Jimmy Zelinskie 2015-06-12 17:04:17 -04:00 committed by Joseph Schorr
commit ae779cade2
3 changed files with 13 additions and 3 deletions

View file

@ -189,7 +189,8 @@
repository="repository"
trigger="currentSetupTrigger"
canceled="cancelSetupTrigger(trigger)"
counter="showTriggerSetupCounter"></div>
counter="showTriggerSetupCounter"
trigger-runner="askRunTrigger(trigger)"></div>
<!-- Manual trigger dialog -->
<div class="manual-trigger-build-dialog"

View file

@ -122,7 +122,10 @@
ng-click="activate()"
ng-show="currentView == 'analyzed'">Create Trigger</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ currentView == 'postActivation' ? 'Done' : 'Cancel' }}</button>
<button type="button" class="btn btn-success" ng-click="runTriggerNow()"
ng-if="currentView == 'postActivation'">Run Trigger Now</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ currentView == 'postActivation' ? 'Done' : 'Cancel' }}</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->

View file

@ -12,7 +12,8 @@ angular.module('quay').directive('setupTriggerDialog', function () {
'trigger': '=trigger',
'counter': '=counter',
'canceled': '&canceled',
'activated': '&activated'
'activated': '&activated',
'triggerRunner': '&triggerRunner'
},
controller: function($scope, $element, ApiService, UserService, TriggerService) {
var modalSetup = false;
@ -55,6 +56,11 @@ angular.module('quay').directive('setupTriggerDialog', function () {
$('#setupTriggerModal').modal('hide');
};
$scope.runTriggerNow = function() {
$('#setupTriggerModal').modal('hide');
$scope.triggerRunner({'trigger': $scope.trigger});
};
$scope.checkAnalyze = function(isValid) {
$scope.currentView = 'analyzing';
$scope.pullInfo = {