Skip to content

Commit

Permalink
[CST-12190] Fix issue with authority enrichment which didn't find the…
Browse files Browse the repository at this point in the history
… proper model to enrich
  • Loading branch information
atarix83 committed Nov 14, 2023
1 parent 02df4d7 commit e0a9e40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/shared/form/builder/form-builder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,10 @@ export class FormBuilderService extends DynamicFormService {
*/
updateModelValue(fieldId: string, value: FormFieldMetadataValueObject): DynamicFormControlModel {
let returnModel = null;
this.formModels.forEach((models, formId) => {
[...this.formModels.keys()].find((formId) => {
const models = this.formModels.get(formId);
const fieldModel: any = this.findById(fieldId, models);
if (hasValue(fieldModel)) {
if (hasValue(fieldModel) && !fieldModel.hidden) {
if (isNotEmpty(value)) {
if (fieldModel.repeatable && isNotEmpty(fieldModel.value)) {
// if model is repeatable and has already a value add a new field instead of replacing it
Expand All @@ -527,8 +528,9 @@ export class FormBuilderService extends DynamicFormService {
returnModel = fieldModel;
}
}
return;
return returnModel;
}
return false;
});
return returnModel;
}
Expand Down

0 comments on commit e0a9e40

Please sign in to comment.