diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx index f548870a51..cbe0d62fd2 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/SurveyStep.jsx @@ -54,8 +54,8 @@ SurveyStep.propTypes = { function TextField({ question, i18n }) { const validators = [ question.required ? required(null, i18n) : null, - question.min ? minLength(question.min, i18n) : null, - question.max ? maxLength(question.max, i18n) : null, + question.required && question.min ? minLength(question.min, i18n) : null, + question.required && question.max ? maxLength(question.max, i18n) : null, ]; return ( 0; diff --git a/awx/ui_next/src/util/prompt/getSurveyValues.js b/awx/ui_next/src/util/prompt/getSurveyValues.js index 17b9fd1aed..0c29344563 100644 --- a/awx/ui_next/src/util/prompt/getSurveyValues.js +++ b/awx/ui_next/src/util/prompt/getSurveyValues.js @@ -5,6 +5,9 @@ export default function getSurveyValues(values) { if (Array.isArray(values[key]) && values[key].length === 0) { return; } + if (key.startsWith('survey_') && values[key] === '') { + return; + } surveyValues[key.substr(7)] = values[key]; } });