diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts index 39615e8f7..5c7258b85 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts @@ -1131,12 +1131,14 @@ export class DescriptionEditorComponent extends BaseEditor this.getNestedSectionIdsByField(subsection, fieldSetId))]; + const subNestedSectionIds: string[] = section.sections.flatMap((subsection: DescriptionTemplateSection) => this.getNestedSectionIdsByField(subsection, fieldSetId)) + if (subNestedSectionIds.length > 0) return [section.id, ...subNestedSectionIds]; + // return [section.id, ...section.sections.flatMap((subsection: DescriptionTemplateSection) => this.getNestedSectionIdsByField(subsection, fieldSetId))]; } else if (section.fieldSets.find(fieldSet => fieldSet.id == fieldSetId)) return [section.id]; - else return []; + return []; } // // this._listenersSubscription.add(dmpSubscription);