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" repository="repository"
trigger="currentSetupTrigger" trigger="currentSetupTrigger"
canceled="cancelSetupTrigger(trigger)" canceled="cancelSetupTrigger(trigger)"
counter="showTriggerSetupCounter"></div> counter="showTriggerSetupCounter"
trigger-runner="askRunTrigger(trigger)"></div>
<!-- Manual trigger dialog --> <!-- Manual trigger dialog -->
<div class="manual-trigger-build-dialog" <div class="manual-trigger-build-dialog"

View file

@ -122,7 +122,10 @@
ng-click="activate()" ng-click="activate()"
ng-show="currentView == 'analyzed'">Create Trigger</button> 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>
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->

View file

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