mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
don't ignore choices param in input config
We always want to use choices if they're available in the input config from the api. An input can sometimes have no type. Usually we'd throw an error but we can still load a component if it defines a set of choices to use instead of a type.
This commit is contained in:
@@ -114,12 +114,16 @@ function AtInputGroupController ($scope, $compile) {
|
|||||||
config._component = 'at-input-checkbox';
|
config._component = 'at-input-checkbox';
|
||||||
} else if (input.type === 'file') {
|
} else if (input.type === 'file') {
|
||||||
config._component = 'at-input-file';
|
config._component = 'at-input-file';
|
||||||
} else if (input.choices) {
|
}
|
||||||
|
|
||||||
|
if (input.choices) {
|
||||||
config._component = 'at-input-select';
|
config._component = 'at-input-select';
|
||||||
config._format = 'array';
|
config._format = 'array';
|
||||||
config._data = input.choices;
|
config._data = input.choices;
|
||||||
config._exp = 'choice for (index, choice) in state._data';
|
config._exp = 'choice for (index, choice) in state._data';
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (!config._component) {
|
||||||
const preface = vm.strings.get('group.UNSUPPORTED_ERROR_PREFACE');
|
const preface = vm.strings.get('group.UNSUPPORTED_ERROR_PREFACE');
|
||||||
throw new Error(`${preface}: ${input.type}`);
|
throw new Error(`${preface}: ${input.type}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user