Compare commits

...

2 Commits

1 changed files with 4 additions and 2 deletions

View File

@ -1131,12 +1131,14 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
getNestedSectionIdsByField(section: DescriptionTemplateSection, fieldSetId: string): string[] {
if (section.sections) {
return [section.id, ...section.sections.flatMap((subsection: DescriptionTemplateSection) => 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);