diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java index 9c504d9e9..3dc89f416 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java @@ -313,7 +313,7 @@ public class DashBoardManager { roles.add(UserDMP.UserDMPRoles.USER.getValue()); roles.add(UserDMP.UserDMPRoles.OWNER.getValue()); dmpList = dataManagementPlanRepository.getAuthenticated(dmpList, principal.getId(), roles); - datasetList = datasetRepository.getAuthenticated(datasetList, user, roles); + datasetList = datasetRepository.getAuthenticated(datasetList, user, roles).distinct(); } @@ -335,7 +335,6 @@ public class DashBoardManager { List recentDatasetModels = datasetList .withHint(HintedModelFactory.getHint(DatasetListingModel.class)) - .distinct() .select(item -> new RecentDatasetModel().fromEntity(item)); recentActivityModels.addAll(recentDatasetModels); }/*);*/ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 23853796a..b8c4ccf0d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -186,6 +186,7 @@ public class DataManagementPlanManager { DatasetCriteria datasetCriteria = new DatasetCriteria(); datasetCriteria.setDmpIds(Collections.singletonList(dmp.getId())); datasetCriteria.setAllVersions(false); + datasetCriteria.setIsPublic(dataManagementPlanTableRequest.getCriteria().getIsPublic()); dmp.setDataset(retrieveRelevantDatasets(datasetCriteria, principalID)); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java index 685632c7f..4cb98b59b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java @@ -192,7 +192,7 @@ public class DatasetManager { if (datasetTableRequest.getCriteria().getRole() != null) { roles.add(datasetTableRequest.getCriteria().getRole()); } - authItems = databaseRepository.getDatasetDao().getAuthenticated(items, userInfo, roles); + authItems = databaseRepository.getDatasetDao().getAuthenticated(items, userInfo, roles).distinct(); pagedItems = PaginationManager.applyPaging(authItems, datasetTableRequest); } else { if (principal.getId() != null && datasetTableRequest.getCriteria().getRole() != null) { @@ -210,9 +210,9 @@ public class DatasetManager { DataTableData dataTable = new DataTableData<>(); - dataTable.setData(pagedItems.distinct().select(this::mapModel).stream().filter(Objects::nonNull).collect(Collectors.toList())); + dataTable.setData(pagedItems.select(this::mapModel).stream().filter(Objects::nonNull).collect(Collectors.toList())); - dataTable.setTotalCount(authItems.distinct().count()); + dataTable.setTotalCount(authItems.count()); //CompletableFuture.allOf(itemsFuture, countFuture).join(); return dataTable;