From 12ea09ed45e0e1aedfc09d7041a08a560ddbdddf Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 17 Jun 2016 10:36:22 -0400 Subject: [PATCH] Make sure that we pass the min/max values back to the api as integers/floats and not strings --- .../survey-maker/survey-maker.block.less | 1 + .../survey-maker/surveys/init.factory.js | 24 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/awx/ui/client/src/job-templates/survey-maker/survey-maker.block.less b/awx/ui/client/src/job-templates/survey-maker/survey-maker.block.less index 785d17f26d..31b6ad5833 100644 --- a/awx/ui/client/src/job-templates/survey-maker/survey-maker.block.less +++ b/awx/ui/client/src/job-templates/survey-maker/survey-maker.block.less @@ -2,6 +2,7 @@ .SurveyMaker-dialog { padding: 0px; + margin-bottom: 20px; .ui-dialog-buttonpane, .ui-dialog-titlebar { display:none; diff --git a/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js b/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js index 7f804565c7..3ada6c7b07 100644 --- a/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js +++ b/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js @@ -352,31 +352,31 @@ export default //set the data.min depending on which type of question if (scope.type.type === 'text') { - data.min = scope.text_min; + data.min = parseInt(scope.text_min); } else if (scope.type.type === 'textarea') { - data.min = scope.textarea_min; + data.min = parseInt(scope.textarea_min); } else if (scope.type.type === 'password') { - data.min = scope.password_min; + data.min = parseInt(scope.password_min); } else if (scope.type.type === 'float') { - data.min = scope.float_min; + data.min = parseFloat(scope.float_min); } else if (scope.type.type === 'integer') { - data.min = scope.int_min; + data.min = parseInt(scope.int_min); } else { - data.min = ""; + data.min = null; } // set hte data max depending on which type if (scope.type.type === 'text') { - data.max = scope.text_max; + data.max = parseInt(scope.text_max); } else if (scope.type.type === 'textarea') { - data.max = scope.textarea_max; + data.max = parseInt(scope.textarea_max); } else if (scope.type.type === 'password') { - data.max = scope.password_max; + data.max = parseInt(scope.password_max); } else if (scope.type.type === 'float') { - data.max = scope.float_max; + data.max = parseFloat(scope.float_max); } else if (scope.type.type === 'integer') { - data.max = scope.int_max; + data.max = parseInt(scope.int_max); } else { - data.max = ""; + data.max = null; } //set the data.default depending on which type