diff --git a/awx/ui/client/lib/components/input/group.directive.js b/awx/ui/client/lib/components/input/group.directive.js index 7570a42cf3..bc255ba4e7 100644 --- a/awx/ui/client/lib/components/input/group.directive.js +++ b/awx/ui/client/lib/components/input/group.directive.js @@ -54,16 +54,18 @@ function AtInputGroupController ($scope, $compile) { vm.createComponentConfigs = inputs => { let group = []; - inputs.forEach((input, i) => { - input = Object.assign(input, vm.getComponentType(input)); + if (inputs) { + inputs.forEach((input, i) => { + input = Object.assign(input, vm.getComponentType(input)); - group.push(Object.assign({ - _element: vm.createComponent(input, i), - _key: 'inputs', - _group: true, - _groupIndex: i - }, input)); - }); + group.push(Object.assign({ + _element: vm.createComponent(input, i), + _key: 'inputs', + _group: true, + _groupIndex: i + }, input)); + }); + } return group; }; diff --git a/awx/ui/client/lib/models/Credential.js b/awx/ui/client/lib/models/Credential.js index 06b824b410..93a5bacfd9 100644 --- a/awx/ui/client/lib/models/Credential.js +++ b/awx/ui/client/lib/models/Credential.js @@ -26,6 +26,10 @@ function createFormSchema (method, config) { } function assignInputGroupValues (inputs) { + if (!inputs) { + return []; + } + return inputs.map(input => { let value = this.get(`inputs.${input.id}`); diff --git a/awx/ui/client/lib/models/CredentialType.js b/awx/ui/client/lib/models/CredentialType.js index e132c05ebb..548bcbca9a 100644 --- a/awx/ui/client/lib/models/CredentialType.js +++ b/awx/ui/client/lib/models/CredentialType.js @@ -15,6 +15,10 @@ function categorizeByKind () { } function mergeInputProperties () { + if (!this.has('inputs.fields')) { + return; + } + let required = this.get('inputs.required'); return this.get('inputs.fields').map((field, i) => {