mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
No surveys for scan job templates
hiding the survey checkboxes, and setting 'survey_enabled' to false for scan job template saves
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc function
|
* @ngdoc function
|
||||||
* @name controllers.function:JobTemplate
|
* @name controllers.function:JobTemplate
|
||||||
@@ -417,8 +417,6 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
|
|||||||
$scope.jobTypeChange = function(){
|
$scope.jobTypeChange = function(){
|
||||||
if($scope.job_type){
|
if($scope.job_type){
|
||||||
if($scope.job_type.value === 'scan'){
|
if($scope.job_type.value === 'scan'){
|
||||||
// $scope.project_name = 'Default';
|
|
||||||
// $scope.project = null;
|
|
||||||
$scope.toggleScanInfo();
|
$scope.toggleScanInfo();
|
||||||
}
|
}
|
||||||
else if($scope.project_name === "Default"){
|
else if($scope.project_name === "Default"){
|
||||||
@@ -614,6 +612,10 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// users can't save a survey with a scan job
|
||||||
|
if($scope.job_type.value === "scan" && $scope.survey_enabled === true){
|
||||||
|
$scope.survey_enabled = false;
|
||||||
|
}
|
||||||
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
||||||
// $scope.$emit("PromptForSurvey");
|
// $scope.$emit("PromptForSurvey");
|
||||||
|
|
||||||
@@ -732,8 +734,6 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
$scope.jobTypeChange = function(){
|
$scope.jobTypeChange = function(){
|
||||||
if($scope.job_type){
|
if($scope.job_type){
|
||||||
if($scope.job_type.value === 'scan'){
|
if($scope.job_type.value === 'scan'){
|
||||||
// $scope.project_name = 'Default';
|
|
||||||
// $scope.project = null;
|
|
||||||
$scope.toggleScanInfo();
|
$scope.toggleScanInfo();
|
||||||
}
|
}
|
||||||
else if($scope.project_name === "Default"){
|
else if($scope.project_name === "Default"){
|
||||||
@@ -742,6 +742,7 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
// $scope.playbook = 'null';
|
// $scope.playbook = 'null';
|
||||||
$scope.job_templates_form.playbook.$setPristine();
|
$scope.job_templates_form.playbook.$setPristine();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1109,6 +1110,10 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// users can't save a survey with a scan job
|
||||||
|
if($scope.job_type.value === "scan" && $scope.survey_enabled === true){
|
||||||
|
$scope.survey_enabled = false;
|
||||||
|
}
|
||||||
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
||||||
// $scope.$emit("PromptForSurvey");
|
// $scope.$emit("PromptForSurvey");
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc function
|
* @ngdoc function
|
||||||
* @name forms.function:JobTemplate
|
* @name forms.function:JobTemplate
|
||||||
@@ -114,17 +114,6 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
},
|
},
|
||||||
// default_scan: {
|
|
||||||
// label: "Use default scan job project and playbook",
|
|
||||||
// type: 'checkbox',
|
|
||||||
// ngChange: 'toggleScanInfo()',
|
|
||||||
// ngShow: 'job_type.value === "scan" && project_name !== "Default"',
|
|
||||||
// column: 1,
|
|
||||||
// awPopOver: "<p>Scan jobs templates use a default project and default playbook. Uncheck this box to override these defaults.</p>",
|
|
||||||
// dataTitle: 'Scan jobs',
|
|
||||||
// dataPlacement: 'right',
|
|
||||||
// dataContainer: "body"
|
|
||||||
// },
|
|
||||||
default_scan: {
|
default_scan: {
|
||||||
type: 'custom',
|
type: 'custom',
|
||||||
column: 1,
|
column: 1,
|
||||||
@@ -263,6 +252,7 @@ export default
|
|||||||
editRequird: false,
|
editRequird: false,
|
||||||
awFeature: 'surveys',
|
awFeature: 'surveys',
|
||||||
ngChange: "surveyEnabled()",
|
ngChange: "surveyEnabled()",
|
||||||
|
ngHide: "job_type.value === 'scan'",
|
||||||
column: 2,
|
column: 2,
|
||||||
awPopOver: "<p>If checked, user will be prompted at job launch with a series of questions related to the job.</p>",
|
awPopOver: "<p>If checked, user will be prompted at job launch with a series of questions related to the job.</p>",
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
@@ -272,6 +262,7 @@ export default
|
|||||||
create_survey: {
|
create_survey: {
|
||||||
type: 'custom',
|
type: 'custom',
|
||||||
column: 2,
|
column: 2,
|
||||||
|
ngHide: "job_type.value === 'scan'" ,
|
||||||
control: '<button type="button" class="btn btn-sm btn-primary" id="job_templates_create_survey_btn" ng-show="survey_enabled" ng-click="addSurvey()"><i class="fa fa-pencil"></i> Create Survey</button>'+
|
control: '<button type="button" class="btn btn-sm btn-primary" id="job_templates_create_survey_btn" ng-show="survey_enabled" ng-click="addSurvey()"><i class="fa fa-pencil"></i> Create Survey</button>'+
|
||||||
'<button style="display:none;" type="button" class="btn btn-sm btn-primary" id="job_templates_edit_survey_btn" ng-show="survey_enabled" ng-click="editSurvey()"><i class="fa fa-pencil"></i> Edit Survey</button>'+
|
'<button style="display:none;" type="button" class="btn btn-sm btn-primary" id="job_templates_edit_survey_btn" ng-show="survey_enabled" ng-click="editSurvey()"><i class="fa fa-pencil"></i> Edit Survey</button>'+
|
||||||
'<button style="display:none;margin-left:5px" type="button" class="btn btn-sm btn-primary" id="job_templates_delete_survey_btn" ng-show="survey_enabled" ng-click="deleteSurvey()"><i class="fa fa-trash-o"></i> Delete Survey</button>'+
|
'<button style="display:none;margin-left:5px" type="button" class="btn btn-sm btn-primary" id="job_templates_delete_survey_btn" ng-show="survey_enabled" ng-click="deleteSurvey()"><i class="fa fa-trash-o"></i> Delete Survey</button>'+
|
||||||
|
|||||||
Reference in New Issue
Block a user