fixed error indication for fields under nested sections

This commit is contained in:
Sofia Papacharalampous 2024-05-10 11:57:07 +03:00
parent ab1e025a75
commit c2c493d896
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);