diff --git a/frontend/src/app/features/content/shared/forms/array-item.component.html b/frontend/src/app/features/content/shared/forms/array-item.component.html index d5d02cc24..0819c0f71 100644 --- a/frontend/src/app/features/content/shared/forms/array-item.component.html +++ b/frontend/src/app/features/content/shared/forms/array-item.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/frontend/src/app/features/content/shared/forms/array-item.component.ts b/frontend/src/app/features/content/shared/forms/array-item.component.ts index 3bd4b14d7..aef249f02 100644 --- a/frontend/src/app/features/content/shared/forms/array-item.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-item.component.ts @@ -72,7 +72,7 @@ export class ArrayItemComponent implements OnChanges { @ViewChildren(ComponentSectionComponent) public sections!: QueryList; - public isInvalid?: Observable; + public isInvalidForm?: Observable; public isInvalidComponent?: Observable; public title?: Observable; @@ -83,7 +83,7 @@ export class ArrayItemComponent implements OnChanges { public ngOnChanges(changes: SimpleChanges) { if (changes['formModel']) { - this.isInvalid = invalid$(this.formModel.form); + this.isInvalidForm = invalid$(this.formModel.form); if (Types.is(this.formModel, ComponentForm)) { this.isInvalidComponent = this.formModel.schemaChanges.pipe(map(x => !x)); @@ -146,15 +146,8 @@ function getTitle(formModel: ObjectFormBase) { let valueLength = 0; - if (Types.is(formModel, ComponentForm) && formModel.schema) { - const formatted = formModel.schema.displayName; - - values.push(formatted); - valueLength += formatted.length; - } - - if (Types.is(formModel.field, RootFieldDto)) { - for (const field of formModel.field.nested) { + function addFields(fields: ReadonlyArray) { + for (const field of fields) { const fieldValue = value[field.name]; if (fieldValue) { @@ -172,5 +165,16 @@ function getTitle(formModel: ObjectFormBase) { } } + if (Types.is(formModel, ComponentForm) && formModel.schema) { + const formatted = formModel.schema.displayName; + + values.push(formatted); + valueLength += formatted.length; + + addFields(formModel.schema.fields); + } else if (Types.is(formModel.field, RootFieldDto)) { + addFields(formModel.field.nested); + } + return values.join(', '); }