diff --git a/awx/ui/static/js/forms.js b/awx/ui/static/js/forms.js index 031b77e5a4..7f619d8d39 100644 --- a/awx/ui/static/js/forms.js +++ b/awx/ui/static/js/forms.js @@ -28,7 +28,6 @@ import Permissions from "tower/forms/Permissions"; import ProjectStatus from "tower/forms/ProjectStatus"; import Projects from "tower/forms/Projects"; import Source from "tower/forms/Source"; -import SurveyMaker from "tower/forms/SurveyMaker"; import SurveyQuestion from "tower/forms/SurveyQuestion"; import Teams from "tower/forms/Teams"; import Users from "tower/forms/Users"; @@ -59,7 +58,6 @@ export ProjectStatus, Projects, Source, - SurveyMaker, SurveyQuestion, Teams, Users diff --git a/awx/ui/static/js/forms/SurveyMaker.js b/awx/ui/static/js/forms/SurveyMaker.js deleted file mode 100644 index 3565d045c4..0000000000 --- a/awx/ui/static/js/forms/SurveyMaker.js +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************* - * Copyright (c) 2015 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - - /** - * @ngdoc function - * @name forms.function:SurveyMaker - * @description This form is for adding/editing a survey -*/ - -export default - angular.module('SurveyMakerFormDefinition', []) - .value('SurveyMakerForm', { - - addTitle: 'Add Survey', //Title in add mode - editTitle: 'Edit Survey', //Title in edit mode - name: 'survey_maker', //entity or model name in singular form - // // well: true, - breadCrumbs: false, - - - fields: { - survey_name: { - type: 'custom', - control: '
'+ - // '
- //
'+ - // ' - //
'+ - // ''+ - // '
Please enter a survey name.
'+ - // '
'+ - // '
'+ - // '
'+ - // '
'+ - // ''+ - // '
'+ - // '
'+ - '
'+ - ''+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '
'//' - // label: 'Survey Name', - // type: 'text', - // addRequired: true, - // editRequired: true, - // capitalize: false, - // // column: 1 - }, - - }, - - // buttons: { //for now always generates '+ ''+ - ''+ + ''+ ''+ - '
'+ - 'Please enter an answer from the choices listed.
'+ - 'The answer is shorter than the minimium length. Please make the answer longer.
'+ - '
'+ - 'The answer is longer than the maximum length. Please make the answer shorter.
'+ - '
'+ + '
The answer is shorter than the minimium length. Please make the answer longer.
' + + '
The answer is longer than the maximum length. Please make the answer shorter.
' + + '
'+ ''+ '', - - // control: '
'+ - // ''+ - // '
'+ - // ''+ - // ''+ - // ''+ - // '
The answer is shorter than the minimium length. Please make the answer longer.
' + - // '
The answer is longer than the maximum length. Please make the answer shorter.
' + - // '
'+ - // '
'+ - // '
', column: 2, ngShow: 'type.type === "password" ' }, @@ -323,7 +295,7 @@ export default }, submit_question: { ngClick: 'submitQuestion($event)', - ngDisabled: true, //'survey_question.$valid', //"!question_name || !variable || !type || ((type.type==='multiplechoice' || type.type === 'multiselect' ) && !choices)", //|| type.type===multiselect ',//'!question_name || !variable || !type' , + ngDisabled: true, 'class': 'btn btn-sm btn-primary', label: 'Add Question' } diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 30cf5cacf7..52f2bcccc7 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name helpers.function:JobSubmission @@ -526,8 +526,10 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, requiredAsterisk = (question.required===true) ? "prepend-asterisk" : ""; requiredClasses = (question.required===true) ? "ng-pristine ng-invalid-required ng-invalid" : ""; - html+='
'; - html += '\n'; + html+='
'; + html += ''; + + // html += '\n'; if(!Empty(question.question_description)){ html += '
'+question.question_description+'
\n'; diff --git a/awx/ui/static/js/helpers/Survey.js b/awx/ui/static/js/helpers/Survey.js index bf008a2135..78af9d3a7f 100644 --- a/awx/ui/static/js/helpers/Survey.js +++ b/awx/ui/static/js/helpers/Survey.js @@ -285,7 +285,10 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', } required = (question.required===true) ? "prepend-asterisk" : ""; - html = '
'+question.question_name+'
\n'; + html = '
'; + html += ''; + html += '
'; + if(!Empty(question.question_description)){ html += '
'+question.question_description+'
\n'; } @@ -326,7 +329,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', if(question.type === 'password'){ defaultValue = (question.default) ? question.default : ""; - defaultValue = $filter('defaultValue')(choices[i]); + defaultValue = $filter('sanitize')(defaultValue); defaultValue = scope.serialize(defaultValue); html+='
'+ '
'+ @@ -925,7 +928,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', } //set the data.default depending on which type - if (scope.type.type === 'text') { + if (scope.type.type === 'text' || scope.type.type === 'multiplechoice') { data.default = scope.default; } else if (scope.type.type === 'textarea') { data.default = scope.default_textarea; @@ -985,7 +988,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', scope.resetForm = function(){ html = '
'+ '
'+ - ''+ + ''+ '
'+ '
'+ ''+ diff --git a/awx/ui/static/less/survey-maker.less b/awx/ui/static/less/survey-maker.less index 5a95056463..7c485bf2d7 100644 --- a/awx/ui/static/less/survey-maker.less +++ b/awx/ui/static/less/survey-maker.less @@ -37,10 +37,9 @@ border-top: 1px dashed; border-color: rgb(204,204,204); border-radius: 4px; - padding: 5px; position: relative; - + .final{ margin-left: 15px; margin-top: 5px; @@ -87,13 +86,3 @@ .survey_taker_description{ margin-bottom:10px } - - - - - - - - - -