description copy fix
This commit is contained in:
parent
435efb3330
commit
8ceca0a98f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue