From 218f93cfdf79b9095a146de57c840fb5159b4f09 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Mon, 6 Jun 2016 13:36:28 -0400 Subject: [PATCH 1/6] Fixed missing double quotes --- .../shared/question-definition.form.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js index 58d95bb3b4..a870cba562 100644 --- a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js +++ b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js @@ -51,7 +51,7 @@ export default '
'+ '
Please enter an answer variable name.
'+ '
Please remove the illegal character from the survey question variable name.
'+ - '
This question variable is already in use. Please enter a different variable name.
' + + '
This question variable is already in use. Please enter a different variable name.
' + '
'+ '
', addRequired: true, @@ -205,9 +205,9 @@ export default ''+ '
'+ ''+ - '
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.
' + + '
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.
' + '
'+ '
'+ '', @@ -222,7 +222,7 @@ export default ''+ '
'+ ''+ - '
Please enter an answer/answers from the choices listed.
' + + '
Please enter an answer/answers from the choices listed.
' + '
'+ '
'+ '', @@ -263,8 +263,8 @@ export default ''+ '
'+ ''+ - '
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.
' + '
'+ '
'+ '', @@ -284,8 +284,8 @@ export default ''+ ''+ ''+ - '
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.
' + '
'+ ''+ '', From 7e0122615e7d18e1077f3342df4a2095ae6371d9 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Mon, 6 Jun 2016 14:53:25 -0400 Subject: [PATCH 2/6] Added default values to the required job template survey questions This is really to fix #1445, the problem being that "" does not pass float validity, and the show/hide was triggering a check which included the hidden-but-still-there float fields. So this is an easy work around, and I think it's better UX as well since these values are required to be filled in in many cases. Fix survey maker add button after toggling password visibility --- .../survey-maker/surveys/init.factory.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 dfd820637c..3cc415843f 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 @@ -204,16 +204,16 @@ export default scope.default_textarea = ""; scope.default_password = "" ; scope.choices = ""; - scope.text_min = ""; - scope.text_max = "" ; - scope.textarea_min = ""; - scope.textarea_max = "" ; - scope.password_min = "" ; - scope.password_max = "" ; - scope.int_min = ""; - scope.int_max = ""; - scope.float_min = ""; - scope.float_max = ""; + scope.text_min = 1; + scope.text_max = 1024 ; + scope.textarea_min = 1; + scope.textarea_max = 4096; + scope.password_min = 1; + scope.password_max = 32; + scope.int_min = 0; + scope.int_max = 100; + scope.float_min = 0.0; + scope.float_max = 100.0; } // Sets all of our scope variables used for adding/editing a question back to a clean state From aa246086609d93b48e530939ea1f91d97a5967a3 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Tue, 7 Jun 2016 13:19:00 -0400 Subject: [PATCH 3/6] Fixed "always invalid" red indicator around survey default password field --- .../survey-maker/shared/question-definition.form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js index a870cba562..9f853e2787 100644 --- a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js +++ b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js @@ -282,7 +282,7 @@ export default ''+ ''+ ''+ - ''+ + ''+ ''+ '
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.
' + From abcd2219fc564a3246811dd6b4ca79b2ecfbbdb7 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Tue, 7 Jun 2016 13:21:21 -0400 Subject: [PATCH 4/6] Fixed 'show' button working the first click for the default password survey field --- .../survey-maker/shared/question-definition.form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js index 9f853e2787..50f79c71fa 100644 --- a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js +++ b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js @@ -280,7 +280,7 @@ export default '
'+ '
'+ ''+ - ''+ + ''+ ''+ ''+ '
'+ From 68cfc7189949212b9f3381f551c498233fec7f71 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Tue, 7 Jun 2016 13:30:20 -0400 Subject: [PATCH 5/6] Fixed show/hide button being slightly too short on default password input field --- .../job-templates/survey-maker/survey-maker.block.less | 8 ++++++++ 1 file changed, 8 insertions(+) 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 c2c70afcc7..785d17f26d 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 @@ -211,3 +211,11 @@ .SurveyMaker-previewDescription { margin-bottom: 5px; } + +.SurveyMaker-questionPanel { + #survey_question_default_password { + button { + height: 30px; /* show/hide button should match our input height */ + } + } +} From 5cb403dffd33d1d4a838621e79144eab1ca3ee5e Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Tue, 7 Jun 2016 13:54:21 -0400 Subject: [PATCH 6/6] Made survey text fields min length default to 0 instead of 1 --- .../src/job-templates/survey-maker/surveys/init.factory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 3cc415843f..7f804565c7 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 @@ -204,11 +204,11 @@ export default scope.default_textarea = ""; scope.default_password = "" ; scope.choices = ""; - scope.text_min = 1; + scope.text_min = 0; scope.text_max = 1024 ; - scope.textarea_min = 1; + scope.textarea_min = 0; scope.textarea_max = 4096; - scope.password_min = 1; + scope.password_min = 0; scope.password_max = 32; scope.int_min = 0; scope.int_max = 100;