From 6b544e4702c6eb0fdd8186d41a4d728f738391be Mon Sep 17 00:00:00 2001 From: Aldo Mihasi Date: Wed, 27 Sep 2023 16:57:25 +0300 Subject: [PATCH] bug fixes --- .../eu/eudat/models/data/dmp/DataManagementPlan.java | 10 ++++++---- .../models/data/dmp/DataManagementPlanEditorModel.java | 3 ++- .../dmp-profile/editor/dmp-profile-editor.component.ts | 4 ++-- .../dmp-editor-blueprint.component.ts | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlan.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlan.java index 01cc8321e..ddf1a0841 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlan.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlan.java @@ -256,10 +256,12 @@ public class DataManagementPlan implements DataModel { if (this.properties != null) { this.extraFields = new ArrayList<>(); this.properties.forEach((id, value) -> { - ExtraFieldModel extraField = new ExtraFieldModel(); - extraField.setId(id); - extraField.setValue(value.toString()); - this.extraFields.add(extraField); + if (value != null) { + ExtraFieldModel extraField = new ExtraFieldModel(); + extraField.setId(id); + extraField.setValue(value.toString()); + this.extraFields.add(extraField); + } }); } if (entity.getUsers() != null && entity.getUsers().stream().anyMatch(userDMP -> userDMP.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue()))) diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java index c356d73d3..fa1862322 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java @@ -378,7 +378,8 @@ public class DataManagementPlanEditorModel implements DataModel(); + this.extraFields.forEach((extraField) -> this.properties.put(extraField.getId(), extraField.getValue())); } dataManagementPlanEntity.setProperties(this.properties != null ? JSONObject.toJSONString(this.properties) : null); dataManagementPlanEntity.setGroupId(this.groupId != null ? this.groupId : UUID.randomUUID()); diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts index 4059cc258..94b6e5e70 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts @@ -430,12 +430,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie hasTitle(): boolean { const dmpBlueprint: DmpBlueprint = this.formGroup.value; - return dmpBlueprint.definition.sections.some(section => section.fields.some(field => field.category === FieldCategory.SYSTEM && field.type === SystemFieldType.TEXT)); + return dmpBlueprint.definition.sections.some(section => section.fields.some(field => field.category as unknown === 'SYSTEM' && field.type === SystemFieldType.TEXT)); } hasDescription(): boolean { const dmpBlueprint: DmpBlueprint = this.formGroup.value; - return dmpBlueprint.definition.sections.some(section => section.fields.some(field => field.category === FieldCategory.SYSTEM && field.type === SystemFieldType.HTML_TEXT)); + return dmpBlueprint.definition.sections.some(section => section.fields.some(field => field.category as unknown === 'SYSTEM' && field.type === SystemFieldType.HTML_TEXT)); } hasDescriptionTemplates(): boolean { diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts index 97df863da..f55a7a9e2 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts @@ -931,7 +931,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im dmpBlueprintSearch(query: string) { let fields: Array = new Array(); - var request = new DataTableRequest(0, 10, { fields: fields }); + var request = new DataTableRequest(0, 20, { fields: fields }); request.criteria = new DmpBlueprintCriteria(); request.criteria.status = DmpProfileStatus.Finalized; return this.dmpProfileService.getPagedBlueprint(request).pipe(map(x => x.data));