Fix issue with related datasets on dashboard
This commit is contained in:
parent
b2825c8369
commit
de4c430d91
|
@ -325,9 +325,11 @@ public class DashBoardManager {
|
||||||
recentActivityModels.addAll(dmps1.stream().map(dmp -> {
|
recentActivityModels.addAll(dmps1.stream().map(dmp -> {
|
||||||
DatasetCriteria datasetCriteria1 = new DatasetCriteria();
|
DatasetCriteria datasetCriteria1 = new DatasetCriteria();
|
||||||
datasetCriteria1.setDmpIds(Collections.singletonList(dmp.getId()));
|
datasetCriteria1.setDmpIds(Collections.singletonList(dmp.getId()));
|
||||||
|
datasetCriteria1.setAllVersions(false);
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
dmp.setDataset(retrieveRelevantDatasets(datasetCriteria1, principal.getId()));
|
dmp.setDataset(retrieveRelevantDatasets(datasetCriteria1, principal.getId()));
|
||||||
} else {
|
} else {
|
||||||
|
datasetCriteria1.setIsPublic(true);
|
||||||
dmp.setDataset(retrieveRelevantDatasets(datasetCriteria1));
|
dmp.setDataset(retrieveRelevantDatasets(datasetCriteria1));
|
||||||
}
|
}
|
||||||
return new RecentDmpModel().fromDataModel(dmp);
|
return new RecentDmpModel().fromDataModel(dmp);
|
||||||
|
@ -447,14 +449,14 @@ public class DashBoardManager {
|
||||||
roles.add(1);
|
roles.add(1);
|
||||||
datasetItems = apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao().getAuthenticated(datasetItems, userInfo, roles);
|
datasetItems = apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao().getAuthenticated(datasetItems, userInfo, roles);
|
||||||
}
|
}
|
||||||
Long maxDatasets = datasetItems.count();
|
Long maxDatasets = datasetItems.distinct().count();
|
||||||
DatasetTableRequest datasetTableRequest = new DatasetTableRequest();
|
DatasetTableRequest datasetTableRequest = new DatasetTableRequest();
|
||||||
datasetTableRequest.setOffset(0);
|
datasetTableRequest.setOffset(0);
|
||||||
datasetTableRequest.setLength(3);
|
datasetTableRequest.setLength(3);
|
||||||
Set<Dataset> datasetsSet = new LinkedHashSet<>();
|
Set<Dataset> datasetsSet = new LinkedHashSet<>();
|
||||||
try {
|
try {
|
||||||
datasetItems = PaginationManager.applyPaging(datasetItems, datasetTableRequest);
|
datasetItems = PaginationManager.applyPaging(datasetItems, datasetTableRequest);
|
||||||
List<Dataset> datasets = datasetItems.toList();
|
List<Dataset> datasets = datasetItems.distinct().toList();
|
||||||
datasetsSet.addAll(datasets);
|
datasetsSet.addAll(datasets);
|
||||||
for (int i = 0; i < maxDatasets - datasets.size(); i++) {
|
for (int i = 0; i < maxDatasets - datasets.size(); i++) {
|
||||||
Dataset fakedataset = new Dataset();
|
Dataset fakedataset = new Dataset();
|
||||||
|
|
Loading…
Reference in New Issue