From da9abc087e37da01a0e04f2bbacad810b8590005 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 22 Mar 2019 10:19:04 -0400 Subject: [PATCH] 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. --- awx/ui/client/lib/components/input/group.directive.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/lib/components/input/group.directive.js b/awx/ui/client/lib/components/input/group.directive.js index 2c589d9266..5272b6cbe7 100644 --- a/awx/ui/client/lib/components/input/group.directive.js +++ b/awx/ui/client/lib/components/input/group.directive.js @@ -114,12 +114,16 @@ function AtInputGroupController ($scope, $compile) { config._component = 'at-input-checkbox'; } else if (input.type === 'file') { config._component = 'at-input-file'; - } else if (input.choices) { + } + + if (input.choices) { config._component = 'at-input-select'; config._format = 'array'; config._data = input.choices; config._exp = 'choice for (index, choice) in state._data'; - } else { + } + + if (!config._component) { const preface = vm.strings.get('group.UNSUPPORTED_ERROR_PREFACE'); throw new Error(`${preface}: ${input.type}`); }