Add validation of github to the config tool
This commit is contained in:
parent
7933bd44fd
commit
5e0ce4eea9
5 changed files with 80 additions and 24 deletions
|
@ -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/';
|
||||
|
|
Reference in a new issue