From 4e097c1f9d67ca66ee705fbd96cba6f8144a343c Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Wed, 1 Apr 2015 13:31:51 -0400 Subject: [PATCH] custom trigger: build trigger config --- static/directives/trigger-setup-custom.html | 12 ++++++------ static/js/directives/ui/trigger-setup-custom.js | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/static/directives/trigger-setup-custom.html b/static/directives/trigger-setup-custom.html index 633ab74ff..bb49d568b 100644 --- a/static/directives/trigger-setup-custom.html +++ b/static/directives/trigger-setup-custom.html @@ -3,14 +3,14 @@ - +
Repository{{ state.gitURL }}{{ state.build_source }}
Dockerfile Location:
- {{ state.currentLocation || '(Repository Root)' }} + {{ state.subdir == '/' || !state.subdir ? '(Repository Root)' : subdir }}
@@ -21,19 +21,19 @@ steps-completed="stepsCompleted()"> -
Please enter the URL used to clone your git repository:
+ ng-model="state.build_source" ng-pattern="/(git|http|https):\/\/(.+)(\.git)/">
-
Dockerfile Location:
+ ng-model="state.subdir" ng-pattern="/^($|\/|\/.+)/">
diff --git a/static/js/directives/ui/trigger-setup-custom.js b/static/js/directives/ui/trigger-setup-custom.js index 2f8ec9ffe..b14899efd 100644 --- a/static/js/directives/ui/trigger-setup-custom.js +++ b/static/js/directives/ui/trigger-setup-custom.js @@ -19,17 +19,26 @@ angular.module('quay').directive('triggerSetupCustom', function() { }, controller: function($scope, $element, ApiService) { $scope.analyzeCounter = 0; - $scope.setupReady = false, + $scope.setupReady = false; $scope.state = { - 'gitURL': null, - 'subdir': null, + 'build_source': null, + 'subdir': null }; $scope.stepsCompleted = function() { - $scope.analyze({'isValid': $scope.state.gitURL != null && $scope.subdir != null}); + $scope.analyze({'isValid': $scope.state.build_source != null && $scope.state.subdir != null}); }; + $scope.$watch('state.build_source', function(build_source) { + $scope.trigger['config']['build_source'] = build_source; + }); + + $scope.$watch('state.subdir', function(subdir) { + $scope.trigger['config']['subdir'] = subdir; + $scope.trigger.$ready = subdir != null; + }); + $scope.nopLoad = function(callback) { callback(); };