1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Fix credential create/edit using type with no fields

This commit is contained in:
gconsidine 2017-08-11 16:55:45 -04:00
parent 9b27bc193f
commit 4a37f049b0
3 changed files with 19 additions and 9 deletions

View File

@ -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;
};

View File

@ -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}`);

View File

@ -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) => {