From 16a205c108d0407f9c59ca58818057ee61d2ae5d Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 12 Jun 2015 17:02:58 -0400 Subject: [PATCH] Add button for running a newly setup trigger This allows users quick access to test their new trigger they just setup Fixes #125 --- static/directives/repo-view/repo-panel-builds.html | 3 ++- static/directives/setup-trigger-dialog.html | 5 ++++- static/js/directives/ui/setup-trigger-dialog.js | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/static/directives/repo-view/repo-panel-builds.html b/static/directives/repo-view/repo-panel-builds.html index 0e5e72172..435da1b85 100644 --- a/static/directives/repo-view/repo-panel-builds.html +++ b/static/directives/repo-view/repo-panel-builds.html @@ -189,7 +189,8 @@ repository="repository" trigger="currentSetupTrigger" canceled="cancelSetupTrigger(trigger)" - counter="showTriggerSetupCounter"> + counter="showTriggerSetupCounter" + trigger-runner="askRunTrigger(trigger)">
Create Trigger - + + +
diff --git a/static/js/directives/ui/setup-trigger-dialog.js b/static/js/directives/ui/setup-trigger-dialog.js index 6696d6cdd..46d0550bb 100644 --- a/static/js/directives/ui/setup-trigger-dialog.js +++ b/static/js/directives/ui/setup-trigger-dialog.js @@ -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 = {