description copy fix

This commit is contained in:
amentis 2024-05-22 13:53:15 +03:00
parent 435efb3330
commit 8ceca0a98f
1 changed files with 5 additions and 1 deletions

View File

@ -54,6 +54,9 @@ export class DescriptionCopyDialogComponent {
fields: [
nameof<Dmp>(x => x.id),
nameof<Dmp>(x => x.label),
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
[nameof<Dmp>(x => x.dmpDescriptionTemplates), nameof<DmpDescriptionTemplate>(x => x.isActive)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.ordinal)].join('.'),
@ -81,7 +84,8 @@ export class DescriptionCopyDialogComponent {
}
findSection(dmp: Dmp){
this.sections = dmp.blueprint.definition.sections.filter(x => x.hasTemplates == true);
const availableSectionIds = dmp.dmpDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId);
this.sections = dmp.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || [];
if(this.sections.length == 1){
this.data.formGroup.get('sectionId').setValue(this.sections[0].id);
}else {