new version ui small fix
This commit is contained in:
parent
d7719d4299
commit
9edec938df
|
@ -34,14 +34,14 @@ export class DmpNewVersionDialogEditorModel implements NewVersionDmpPersist {
|
|||
|
||||
if (item.dmpDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) {
|
||||
item.descriptions.forEach(description => {
|
||||
const matchingSection = item.dmpDescriptionTemplates.find(dmpDescriptionTemplate => dmpDescriptionTemplate.descriptionTemplateGroupId === description.descriptionTemplate.groupId);
|
||||
const matchingSection = item.dmpDescriptionTemplates.find(dmpDescriptionTemplate => dmpDescriptionTemplate.descriptionTemplateGroupId === description.descriptionTemplate.groupId) || null;
|
||||
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.sectionId : null));
|
||||
})
|
||||
} else{
|
||||
const selectedBlueprintSections = blueprint.definition?.sections?.filter(x => x.hasTemplates) || null;
|
||||
if (selectedBlueprintSections != null){
|
||||
item.descriptions.forEach(description => {
|
||||
const matchingSection = selectedBlueprintSections.find(blueprintSection => blueprintSection.descriptionTemplates.map(y => y.descriptionTemplateGroupId).includes(description.descriptionTemplate.groupId));
|
||||
const matchingSection = selectedBlueprintSections.find(blueprintSection => blueprintSection.descriptionTemplates != null && blueprintSection.descriptionTemplates.map(y => y.descriptionTemplateGroupId).includes(description.descriptionTemplate.groupId)) || null;
|
||||
this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null));
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue