mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 07:28:02 -03:30
Fixed bug where optional single select survey questions with a default value couldn't be skipped
This commit is contained in:
parent
f0102ef0ff
commit
9a678c72dc
@ -42,6 +42,13 @@ export default
|
||||
else if(question.type === "multiplechoice") {
|
||||
question.model = question.default ? angular.copy(question.default) : "";
|
||||
question.choices = question.choices.split(/\n/);
|
||||
|
||||
// Add a default empty string option to the choices array. If this choice is
|
||||
// selected then the extra var will not be sent when we POST to the launch
|
||||
// endpoint
|
||||
if(!question.required) {
|
||||
question.choices.unshift('');
|
||||
}
|
||||
}
|
||||
else if(question.type === "float"){
|
||||
question.model = (!Empty(question.default)) ? angular.copy(question.default) : (!Empty(question.default_float)) ? angular.copy(question.default_float) : "";
|
||||
|
||||
@ -90,9 +90,9 @@ export default
|
||||
// for optional select lists, if they are left blank make sure we submit
|
||||
// a value that the API will consider "empty"
|
||||
//
|
||||
case "multiplechoice":
|
||||
job_launch_data.extra_vars[fld] = "";
|
||||
break;
|
||||
// ISSUE: I don't think this logic ever actually fires
|
||||
// When I tested this, we don't pass this extra var back
|
||||
// through the api when the mutliselect is optional and empty
|
||||
case "multiselect":
|
||||
job_launch_data.extra_vars[fld] = [];
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user