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) {
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())))

View File

@ -378,7 +378,8 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
dataManagementPlanEntity.setAssociatedDmps(dmpDatasetProfiles);
}
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.setGroupId(this.groupId != null ? this.groupId : UUID.randomUUID());

View File

@ -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 {

View File

@ -931,7 +931,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
dmpBlueprintSearch(query: string) {
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.status = DmpProfileStatus.Finalized;
return this.dmpProfileService.getPagedBlueprint(request).pipe(map(x => x.data));