This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/ui/trigger-setup-custom.js

50 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-03-27 21:07:06 +00:00
/**
* An element which displays custom git-specific setup information for its build triggers.
*/
angular.module('quay').directive('triggerSetupCustom', function() {
var directiveDefinitionObject = {
priority: 0,
templateUrl: '/static/directives/trigger-setup-custom.html',
replace: false,
transclude: false,
restrict: 'C',
scope: {
'repository': '=repository',
'trigger': '=trigger',
'nextStepCounter': '=nextStepCounter',
'currentStepValid': '=currentStepValid',
'analyze': '&analyze'
},
controller: function($scope, $element, ApiService) {
$scope.analyzeCounter = 0;
2015-04-01 17:31:51 +00:00
$scope.setupReady = false;
2015-03-27 21:07:06 +00:00
$scope.state = {
2015-04-01 17:31:51 +00:00
'build_source': null,
'subdir': null
2015-03-27 21:07:06 +00:00
};
$scope.stepsCompleted = function() {
2015-04-01 17:31:51 +00:00
$scope.analyze({'isValid': $scope.state.build_source != null && $scope.state.subdir != null});
2015-03-31 21:12:40 +00:00
};
2015-04-01 17:31:51 +00:00
$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;
});
2015-03-31 21:12:40 +00:00
$scope.nopLoad = function(callback) {
callback();
2015-03-27 21:07:06 +00:00
};
}
};
return directiveDefinitionObject;
});