1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

fix small error w/ playbook options when type=scan

This commit is contained in:
Jared Tabor 2015-03-19 11:22:54 -04:00
parent 2885ad4cb2
commit 8b710c191b

View File

@ -349,6 +349,7 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
$scope.default_scan = true; $scope.default_scan = true;
$scope.project_name = 'Default'; $scope.project_name = 'Default';
$scope.project = null; $scope.project = null;
$scope.toggleScanInfo();
} }
else{ else{
$scope.default_scan = false; $scope.default_scan = false;
@ -683,34 +684,6 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log,
$scope.playbook = null; $scope.playbook = null;
generator.reset(); generator.reset();
$scope.jobTypeChange = function(){
if($scope.job_type){
if($scope.job_type.value === 'scan'){
$scope.default_scan = true;
$scope.project_name = 'Default';
$scope.project = null;
}
else{
$scope.default_scan = false;
$scope.project_name = null;
$scope.playbook_options = [];
$scope.playbook = 'null';
}
}
};
$scope.toggleScanInfo = function() {
if($scope.default_scan){
$scope.project_name = 'Default';
$scope.project = null;
}
if(!$scope.default_scan){
$scope.project_name = null;
$scope.playbook_options = [];
$scope.playbook = 'null';
}
};
getPlaybooks = function (project) { getPlaybooks = function (project) {
var url; var url;
if($scope.job_type.value === 'scan' && $scope.default_scan === true){ if($scope.job_type.value === 'scan' && $scope.default_scan === true){
@ -749,6 +722,36 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log,
} }
}; };
$scope.jobTypeChange = function(){
if($scope.job_type){
if($scope.job_type.value === 'scan'){
$scope.default_scan = true;
$scope.project_name = 'Default';
$scope.project = null;
$scope.toggleScanInfo();
}
else{
$scope.default_scan = false;
$scope.project_name = null;
$scope.playbook_options = [];
$scope.playbook = 'null';
}
}
};
$scope.toggleScanInfo = function() {
if($scope.default_scan){
$scope.project_name = 'Default';
$scope.project = null;
getPlaybooks();
}
if(!$scope.default_scan){
$scope.project_name = null;
$scope.playbook_options = [];
$scope.playbook = 'null';
}
};
// Detect and alert user to potential SCM status issues // Detect and alert user to potential SCM status issues
checkSCMStatus = function () { checkSCMStatus = function () {
if (!Empty($scope.project)) { if (!Empty($scope.project)) {