bug fixes

This commit is contained in:
Bernaldo Mihasi 2023-09-27 16:57:25 +03:00
parent 0bd3422903
commit 6b544e4702
4 changed files with 11 additions and 8 deletions

View File

@ -256,10 +256,12 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
if (this.properties != null) { if (this.properties != null) {
this.extraFields = new ArrayList<>(); this.extraFields = new ArrayList<>();
this.properties.forEach((id, value) -> { this.properties.forEach((id, value) -> {
ExtraFieldModel extraField = new ExtraFieldModel(); if (value != null) {
extraField.setId(id); ExtraFieldModel extraField = new ExtraFieldModel();
extraField.setValue(value.toString()); extraField.setId(id);
this.extraFields.add(extraField); extraField.setValue(value.toString());
this.extraFields.add(extraField);
}
}); });
} }
if (entity.getUsers() != null && entity.getUsers().stream().anyMatch(userDMP -> userDMP.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue()))) if (entity.getUsers() != null && entity.getUsers().stream().anyMatch(userDMP -> userDMP.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())))

View File

@ -378,7 +378,8 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
dataManagementPlanEntity.setAssociatedDmps(dmpDatasetProfiles); dataManagementPlanEntity.setAssociatedDmps(dmpDatasetProfiles);
} }
if(this.extraFields != null) { if(this.extraFields != null) {
this.properties = this.extraFields.stream().collect(Collectors.toMap(ExtraFieldModel::getId, ExtraFieldModel::getValue)); this.properties = new HashMap<>();
this.extraFields.forEach((extraField) -> this.properties.put(extraField.getId(), extraField.getValue()));
} }
dataManagementPlanEntity.setProperties(this.properties != null ? JSONObject.toJSONString(this.properties) : null); dataManagementPlanEntity.setProperties(this.properties != null ? JSONObject.toJSONString(this.properties) : null);
dataManagementPlanEntity.setGroupId(this.groupId != null ? this.groupId : UUID.randomUUID()); dataManagementPlanEntity.setGroupId(this.groupId != null ? this.groupId : UUID.randomUUID());

View File

@ -430,12 +430,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
hasTitle(): boolean { hasTitle(): boolean {
const dmpBlueprint: DmpBlueprint = this.formGroup.value; 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 { hasDescription(): boolean {
const dmpBlueprint: DmpBlueprint = this.formGroup.value; 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 { hasDescriptionTemplates(): boolean {

View File

@ -931,7 +931,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
dmpBlueprintSearch(query: string) { dmpBlueprintSearch(query: string) {
let fields: Array<string> = new Array(); let fields: Array<string> = new Array();
var request = new DataTableRequest<DmpBlueprintCriteria>(0, 10, { fields: fields }); var request = new DataTableRequest<DmpBlueprintCriteria>(0, 20, { fields: fields });
request.criteria = new DmpBlueprintCriteria(); request.criteria = new DmpBlueprintCriteria();
request.criteria.status = DmpProfileStatus.Finalized; request.criteria.status = DmpProfileStatus.Finalized;
return this.dmpProfileService.getPagedBlueprint(request).pipe(map(x => x.data)); return this.dmpProfileService.getPagedBlueprint(request).pipe(map(x => x.data));