Add validation of github to the config tool

This commit is contained in:
Joseph Schorr 2015-01-08 13:26:24 -05:00
parent 7933bd44fd
commit 5e0ce4eea9
5 changed files with 80 additions and 24 deletions

View file

@ -29,6 +29,10 @@ angular.module("core-config-setup", ['angularFileUpload'])
{'id': 'github-login', 'title': 'Github (Enterprise) Authentication', 'condition': function(config) {
return config.FEATURE_GITHUB_LOGIN;
}},
{'id': 'github-trigger', 'title': 'Github (Enterprise) Build Triggers', 'condition': function(config) {
return config.FEATURE_GITHUB_BUILD;
}}
];
@ -151,8 +155,10 @@ angular.module("core-config-setup", ['angularFileUpload'])
}
if (value == 'enterprise') {
$scope.config[key]['GITHUB_ENDPOINT'] = '';
$scope.config[key]['API_ENDPOINT'] = '';
if ($scope.config[key]['GITHUB_ENDPOINT'] == 'https://github.com/') {
$scope.config[key]['GITHUB_ENDPOINT'] = '';
}
delete $scope.config[key]['API_ENDPOINT'];
} else if (value == 'hosted') {
$scope.config[key]['GITHUB_ENDPOINT'] = 'https://github.com/';
$scope.config[key]['API_ENDPOINT'] = 'https://api.github.com/';