Merge pull request #252 from gconsidine/ui/fix/credential-with-empty-type

Fix credential create/edit using type with no fields
This commit is contained in:
Greg Considine
2017-08-11 17:16:13 -04:00
committed by GitHub
3 changed files with 19 additions and 9 deletions

View File

@@ -54,16 +54,18 @@ function AtInputGroupController ($scope, $compile) {
vm.createComponentConfigs = inputs => { vm.createComponentConfigs = inputs => {
let group = []; let group = [];
inputs.forEach((input, i) => { if (inputs) {
input = Object.assign(input, vm.getComponentType(input)); inputs.forEach((input, i) => {
input = Object.assign(input, vm.getComponentType(input));
group.push(Object.assign({ group.push(Object.assign({
_element: vm.createComponent(input, i), _element: vm.createComponent(input, i),
_key: 'inputs', _key: 'inputs',
_group: true, _group: true,
_groupIndex: i _groupIndex: i
}, input)); }, input));
}); });
}
return group; return group;
}; };

View File

@@ -26,6 +26,10 @@ function createFormSchema (method, config) {
} }
function assignInputGroupValues (inputs) { function assignInputGroupValues (inputs) {
if (!inputs) {
return [];
}
return inputs.map(input => { return inputs.map(input => {
let value = this.get(`inputs.${input.id}`); let value = this.get(`inputs.${input.id}`);

View File

@@ -15,6 +15,10 @@ function categorizeByKind () {
} }
function mergeInputProperties () { function mergeInputProperties () {
if (!this.has('inputs.fields')) {
return;
}
let required = this.get('inputs.required'); let required = this.get('inputs.required');
return this.get('inputs.fields').map((field, i) => { return this.get('inputs.fields').map((field, i) => {