diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index d8511147f8..36fce67368 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -221,29 +221,6 @@ export default dataTitle: 'Prompt for Extra Variables', dataContainer: "body" }, - survey_enabled: { - label: 'Enable Survey', - type: 'checkbox', - addRequired: false, - editRequird: false, - awFeature: 'surveys', - ngChange: "surveyEnabled()", - ngHide: "job_type.value === 'scan'", - column: 2, - awPopOver: "

If checked, user will be prompted at job launch with a series of questions related to the job.

", - dataPlacement: 'right', - dataTitle: 'Enable Survey', - dataContainer: "body" - }, - create_survey: { - type: 'custom', - column: 2, - ngHide: "job_type.value === 'scan'" , - control: ''+ - ''+ - ''+ - '
A survey is enabled but it does not exist. Create a survey or uncheck the Enable Survey box to disable the survey.
' - }, become_enabled: { label: 'Enable Privilege Escalation', type: 'checkbox', @@ -294,6 +271,13 @@ export default dataPlacement: 'right', dataTitle: "Host Config Key", dataContainer: "body" + }, + survey: { + type: 'custom', + column: 2, + ngHide: "job_type.value === 'scan'" , + control: ''+ + '' } }, diff --git a/awx/ui/client/src/helpers/Hosts.js b/awx/ui/client/src/helpers/Hosts.js index 83eef613f2..f55b1199d2 100644 --- a/awx/ui/client/src/helpers/Hosts.js +++ b/awx/ui/client/src/helpers/Hosts.js @@ -487,7 +487,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name, minWidth: 400, title: 'Host Properties', id: 'host-modal-dialog', - clonseOnEscape: false, + closeOnEscape: false, form: form_scope.host_form, onClose: function() { Wait('stop'); diff --git a/awx/ui/client/src/helpers/JobTemplates.js b/awx/ui/client/src/helpers/JobTemplates.js index b7068e0cb8..44a4604bca 100644 --- a/awx/ui/client/src/helpers/JobTemplates.js +++ b/awx/ui/client/src/helpers/JobTemplates.js @@ -92,17 +92,7 @@ angular.module('JobTemplatesHelper', ['Utilities']) } else { scope[fld] = data[fld]; if(fld ==='survey_enabled'){ - // $scope.$emit('EnableSurvey', fld); - $('#job_templates_survey_enabled_chbox').attr('checked', scope[fld]); - if(Empty(data.summary_fields.survey)) { - $('#job_templates_delete_survey_btn').hide(); - $('#job_templates_edit_survey_btn').hide(); - $('#job_templates_create_survey_btn').show(); - } - else{ - $('#job_templates_delete_survey_btn').show(); - $('#job_templates_edit_survey_btn').show(); - $('#job_templates_create_survey_btn').hide(); + if(!Empty(data.summary_fields.survey)) { scope.survey_exists = true; } } diff --git a/awx/ui/client/src/helpers/inventory.js b/awx/ui/client/src/helpers/inventory.js index cd85eb2d04..9becb2dbb9 100644 --- a/awx/ui/client/src/helpers/inventory.js +++ b/awx/ui/client/src/helpers/inventory.js @@ -139,7 +139,7 @@ export default minWidth: 400, title: 'Inventory Properties', id: 'inventory-edit-modal-dialog', - clonseOnEscape: false, + closeOnEscape: false, form: form_scope.inventory_form, onClose: function() { Wait('stop'); diff --git a/awx/ui/client/src/job-templates/add/job-templates-add.controller.js b/awx/ui/client/src/job-templates/add/job-templates-add.controller.js index 1c7000d399..327c9cc61b 100644 --- a/awx/ui/client/src/job-templates/add/job-templates-add.controller.js +++ b/awx/ui/client/src/job-templates/add/job-templates-add.controller.js @@ -299,11 +299,6 @@ Wait('stop'); $scope.survey_exists = true; $scope.invalid_survey = false; - $('#job_templates_survey_enabled_chbox').attr('checked', true); - $('#job_templates_delete_survey_btn').show(); - $('#job_templates_edit_survey_btn').show(); - $('#job_templates_create_survey_btn').hide(); - }); diff --git a/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js b/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js index 786358d52d..f51c6a77f9 100644 --- a/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js +++ b/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js @@ -316,16 +316,8 @@ export default Rest.setUrl(defaultUrl + id+ '/survey_spec/'); Rest.get() .success(function (data) { - if(!data || !data.name){ - $('#job_templates_delete_survey_btn').hide(); - $('#job_templates_edit_survey_btn').hide(); - $('#job_templates_create_survey_btn').show(); - } - else { + if(data && data.name){ $scope.survey_exists = true; - $('#job_templates_delete_survey_btn').show(); - $('#job_templates_edit_survey_btn').show(); - $('#job_templates_create_survey_btn').hide(); } }) .error(function (data, status) { @@ -343,11 +335,6 @@ export default Wait('stop'); $scope.survey_exists = true; $scope.invalid_survey = false; - $('#job_templates_survey_enabled_chbox').attr('checked', true); - $('#job_templates_delete_survey_btn').show(); - $('#job_templates_edit_survey_btn').show(); - $('#job_templates_create_survey_btn').hide(); - }); if ($scope.removeLoadJobs) { @@ -564,33 +551,5 @@ export default }); } }; - - // handler for 'Enable Survey' button - $scope.surveyEnabled = function(){ - Rest.setUrl(defaultUrl + id+ '/'); - Rest.patch({"survey_enabled": $scope.survey_enabled}) - .success(function (data) { - - if(Empty(data.summary_fields.survey)){ - $('#job_templates_delete_survey_btn').hide(); - $('#job_templates_edit_survey_btn').hide(); - $('#job_templates_create_survey_btn').show(); - } - else{ - $scope.survey_exists = true; - $('#job_templates_delete_survey_btn').show(); - $('#job_templates_edit_survey_btn').show(); - $('#job_templates_create_survey_btn').hide(); - } - }) - .error(function (data, status) { - ProcessErrors($scope, data, status, form, { - hdr: 'Error!', - msg: 'Failed to retrieve save survey_enabled: ' + $stateParams.template_id + '. GET status: ' + status - }); - }); - }; - - } ];