diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js index 005e8e1226..b798b94cb3 100644 --- a/awx/ui/static/js/forms/SurveyQuestion.js +++ b/awx/ui/static/js/forms/SurveyQuestion.js @@ -76,19 +76,39 @@ angular.module('SurveyQuestionFormDefinition', []) dataContainer: "body", column: 2 }, + // text_options: { + // realName: 'answer_options', + // type: 'custom', + // control:'
'+ + // '
'+ + // ''+ + // '
This is not valid integer!
'+ + // '
Too high!
'+ + // '
'+ + // // '
'+ + // // ''+ + // // '
This is not valid integer!
'+ + // // '
Too low!
'+ + // // '
'+ + // '
', + // ngShow: 'type.type==="text" ', + // addRequired: true, + // editRequired: true, + // column: 2 + // }, int_options: { realName: 'answer_options', type: 'custom', control:'
'+ '
'+ - ''+ + ''+ '
This is not valid integer!
'+ - '
Too high!
'+ + '
Too high!
'+ '
'+ '
'+ - ''+ + ''+ '
This is not valid integer!
'+ - '
Too low!
'+ + '
Too low!
'+ '
'+ '
', ngShow: 'type.type==="integer" ', @@ -101,12 +121,15 @@ angular.module('SurveyQuestionFormDefinition', []) type: 'custom', control: '
'+ '
'+ - ''+ - '
This is not valid float!
'+ + ''+ + '
This is not valid float!
'+ + '
Too high!
'+ '
'+ '
'+ - ''+ - '
This is not valid float!
'+ + ''+ + '
This is not valid float!
'+ + '
Too low!
'+ + '
'+ '
', ngShow: 'type.type==="float" ', @@ -121,8 +144,19 @@ angular.module('SurveyQuestionFormDefinition', []) addRequired: false, editRequired: false, column: 2, - ngHide: 'type.type === "textarea" || type.type === "multiselect" || type.type === "integer" || type.type === "float" ' + ngHide: 'type.type === "textarea" || type.type === "multiselect" || type.type === "integer" || type.type === "float" ' // type.type === "text" || }, + // default_text: { + // realName: 'default_answer', + // type: 'custom', + // control: '
'+ + // ''+ + // '{{text_min}} survey_question_form.default_text.$error.minlength = {{survey_question_form.default_text.$error.minlength}}'+ + // '
The answer must be between {{text_min}} to {{text_max}} characters long!
'+ + // '
', + // column: 2, + // ngShow: 'type.type === "text" ' + // }, default_multiselect: { realName: 'default_answer', label: 'Default Answer', @@ -138,9 +172,9 @@ angular.module('SurveyQuestionFormDefinition', []) type: 'custom', control: '
'+ ''+ - ''+ + ''+ '
This is not valid integer!
'+ - '
The value must be in range {{int_min}} to {{int_max}}!
'+ + '
The value must be in range {{int_min}} to {{int_max}}!
'+ '
', column: 2, ngShow: 'type.type === "integer" ' @@ -150,9 +184,9 @@ angular.module('SurveyQuestionFormDefinition', []) type: 'custom', control: '
'+ ''+ - ''+ + ''+ '
This is not valid float!
'+ - '
The value must be in range {{float_min}} to {{float_max}}!
'+ + '
The value must be in range {{float_min}} to {{float_max}}!
'+ '
', column: 2, ngShow: 'type.type=== "float" ' diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 8fd91ef9d6..3248705d85 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -517,10 +517,10 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi if(question.type === 'integer'){ min = (!Empty(question.min)) ? Number(question.min) : ""; max = (!Empty(question.max)) ? Number(question.max) : "" ; - html+=''+ + html+=''+ '
A value is required!
'+ '
This is not valid integer!
'+ - '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; + '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; } @@ -528,9 +528,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi min = (!Empty(question.min)) ? question.min : ""; max = (!Empty(question.max)) ? question.max : "" ; defaultValue = (!Empty(question.default)) ? question.default : (!Empty(question.default_float)) ? question.default_float : "" ; - html+=''+ + html+=''+ '
This is not valid float!
'+ - '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; + '
The value must be in range {{'+min+'}} to {{'+max+'}}!
'; } html+=''; if(question.index === scope.survey_questions.length-1){ diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 76d7799cd9..d98c9e9cf3 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -144,18 +144,18 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job }; }) - .directive('ngMin', ['Empty', function (Empty) { + .directive('awMin', ['Empty', function (Empty) { return { restrict: 'A', require: 'ngModel', link: function (scope, elem, attr, ctrl) { ctrl.$parsers.unshift( function(viewValue) { - var min = (attr.ngMin) ? scope.$eval(attr.ngMin) : -Infinity; + var min = (attr.awMin) ? scope.$eval(attr.awMin) : -Infinity; if (!Empty(min) && !Empty(viewValue) && Number(viewValue) < min) { - ctrl.$setValidity('ngMin', false); + ctrl.$setValidity('awMin', false); return undefined; } else { - ctrl.$setValidity('ngMin', true); + ctrl.$setValidity('awMin', true); return viewValue; } }); @@ -163,18 +163,18 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job }; }]) - .directive('ngMax', ['Empty', function (Empty) { + .directive('awMax', ['Empty', function (Empty) { return { restrict: 'A', require: 'ngModel', link: function (scope, elem, attr, ctrl) { ctrl.$parsers.unshift( function(viewValue) { - var max = (attr.ngMax) ? scope.$eval(attr.ngMax) : Infinity; + var max = (attr.awMax) ? scope.$eval(attr.awMax) : Infinity; if (!Empty(max) && !Empty(viewValue) && Number(viewValue) > max) { - ctrl.$setValidity('ngMax', false); + ctrl.$setValidity('awMax', false); return undefined; } else { - ctrl.$setValidity('ngMax', true); + ctrl.$setValidity('awMax', true); return viewValue; } });