Skip to content
Snippets Groups Projects
Commit 3651b16b authored by Giuseppe Digilio's avatar Giuseppe Digilio
Browse files

Fixed issue with form value init within relation fields

parent 0cc130a8
Branches
Tags
No related merge requests found
......@@ -129,11 +129,11 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
|| this.selectedChipItem.item[model.name].value === PLACEHOLDER_PARENT_METADATA)
? null
: this.selectedChipItem.item[model.name];
if (isNotNull(value)) {
const nextValue = (this.formBuilderService.isInputModel(model) && (typeof value !== 'string')) ?
value.value : value;
model.valueUpdates.next(nextValue);
}
const nextValue = (this.formBuilderService.isInputModel(model) && isNotNull(value) && (typeof value !== 'string')) ?
value.value : value;
model.valueUpdates.next(nextValue);
});
});
......@@ -231,7 +231,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
flatMap((valueModel) => {
const returnList: Array<Observable<any>> = [];
valueModel.forEach((valueObj) => {
const returnObj = Object.keys(valueObj).map((fieldName) => {
const returnObj = Object.keys(valueObj).map((fieldName) => {
let return$: Observable<any>;
if (isObject(valueObj[fieldName]) && valueObj[fieldName].hasAuthority() && isNotEmpty(valueObj[fieldName].authority)) {
const fieldId = fieldName.replace(/\./g, '_');
......@@ -255,7 +255,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
} else {
return$ = observableOf(valueObj[fieldName]);
}
return return$.pipe(map((entry) => ({[fieldName]: entry})));
return return$.pipe(map((entry) => ({ [fieldName]: entry })));
});
returnList.push(combineLatest(returnObj));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment