Merge branch 'Development' of https://code-repo.d4science.org/MaDgiK-CITE/argos into Development

# Conflicts:
#	dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts
This commit is contained in:
Diamantis Tziotzios 2024-01-24 14:48:38 +02:00
commit a1849c64ca
2 changed files with 8 additions and 1 deletions

View File

@ -544,6 +544,14 @@ public class DataManagementPlanManager {
}
if(newDmp.getId() != null){
UUID dmpId = newDmp.getId();
List<DMPDatasetProfile> dmpDatasetProfiles = apiContext.getOperationsContext().getDatabaseRepository().getDmpDatasetProfileDao().asQueryable()
.where((builder, root) -> builder.equal(root.get("dmp").get("id"), dmpId)).toList();
for (DMPDatasetProfile dmpDatasetProfile : dmpDatasetProfiles) {
if (newDmp.getAssociatedDmps().stream().filter(dmpDatasetProfile1 -> dmpDatasetProfile1.getId() != null).noneMatch(dmpDatasetProfile1 -> dmpDatasetProfile1.getId().equals(dmpDatasetProfile.getId()))) {
apiContext.getOperationsContext().getDatabaseRepository().getDmpDatasetProfileDao().delete(dmpDatasetProfile);
}
}
for(DMPDatasetProfile dmpDatasetProfile : newDmp.getAssociatedDmps()){
apiContext.getOperationsContext().getDatabaseRepository().getDmpDatasetProfileDao().createOrUpdate(dmpDatasetProfile);
}

View File

@ -1102,7 +1102,6 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
else return true;
}
onRemoveTemplate(event, sectionIndex: number) {
let profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[];
this.sectionTemplates[sectionIndex] = this.sectionTemplates[sectionIndex].filter(sectionProfile => sectionProfile.id !== event.id);