Change Dataset sorting on DMP overview and editor from last modified to last created
This commit is contained in:
parent
b9f8d2e162
commit
2a12f1b5be
|
@ -291,7 +291,7 @@ public class DataManagementPlanManager {
|
||||||
if (includeDatasets) {
|
if (includeDatasets) {
|
||||||
dataManagementPlan.fromDataModel(dataManagementPlanEntity);
|
dataManagementPlan.fromDataModel(dataManagementPlanEntity);
|
||||||
dataManagementPlan.getDatasets().forEach(datasetWizardModel -> datasetWizardModel.setDescription(null));
|
dataManagementPlan.getDatasets().forEach(datasetWizardModel -> datasetWizardModel.setDescription(null));
|
||||||
dataManagementPlan.setDatasets(dataManagementPlan.getDatasets().stream().sorted(Comparator.comparing(DatasetWizardModel::getModified).reversed()).collect(Collectors.toList()));
|
dataManagementPlan.setDatasets(dataManagementPlan.getDatasets().stream().sorted(Comparator.comparing(DatasetWizardModel::getCreated).reversed()).collect(Collectors.toList()));
|
||||||
//List<Dataset> datasetEnities = new ArrayList<>(dataManagementPlanEntity.getDataset());
|
//List<Dataset> datasetEnities = new ArrayList<>(dataManagementPlanEntity.getDataset());
|
||||||
/*for (int i = 0; i < datasetEnities.size(); i++) {
|
/*for (int i = 0; i < datasetEnities.size(); i++) {
|
||||||
for (int j = i; j < dataManagementPlan.getDatasets().size(); j++) {
|
for (int j = i; j < dataManagementPlan.getDatasets().size(); j++) {
|
||||||
|
@ -343,7 +343,7 @@ public class DataManagementPlanManager {
|
||||||
}
|
}
|
||||||
DataManagementPlanOverviewModel datamanagementPlan = new DataManagementPlanOverviewModel();
|
DataManagementPlanOverviewModel datamanagementPlan = new DataManagementPlanOverviewModel();
|
||||||
datamanagementPlan.fromDataModelDatasets(dataManagementPlanEntity);
|
datamanagementPlan.fromDataModelDatasets(dataManagementPlanEntity);
|
||||||
datamanagementPlan.setDatasets(datamanagementPlan.getDatasets().stream().sorted(Comparator.comparing(DatasetOverviewModel::getModified).reversed()).collect(Collectors.toList()));
|
datamanagementPlan.setDatasets(datamanagementPlan.getDatasets().stream().sorted(Comparator.comparing(DatasetOverviewModel::getCreated).reversed()).collect(Collectors.toList()));
|
||||||
if (isPublic) {
|
if (isPublic) {
|
||||||
datamanagementPlan.setDatasets(datamanagementPlan.getDatasets().stream().filter(dataset -> dataset.getStatus() == Dataset.Status.FINALISED.getValue()).collect(Collectors.toList()));
|
datamanagementPlan.setDatasets(datamanagementPlan.getDatasets().stream().filter(dataset -> dataset.getStatus() == Dataset.Status.FINALISED.getValue()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewM
|
||||||
private String description;
|
private String description;
|
||||||
private Boolean isPublic;
|
private Boolean isPublic;
|
||||||
private Date modified;
|
private Date modified;
|
||||||
|
private Date created;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -101,6 +102,14 @@ public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewM
|
||||||
this.modified = modified;
|
this.modified = modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(Date created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetOverviewModel fromDataModel(Dataset entity) {
|
public DatasetOverviewModel fromDataModel(Dataset entity) {
|
||||||
this.id = entity.getId();
|
this.id = entity.getId();
|
||||||
|
@ -113,6 +122,7 @@ public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewM
|
||||||
this.description = entity.getDescription();
|
this.description = entity.getDescription();
|
||||||
this.isPublic = entity.getDmp().isPublic();
|
this.isPublic = entity.getDmp().isPublic();
|
||||||
this.modified = entity.getModified();
|
this.modified = entity.getModified();
|
||||||
|
this.created = entity.getCreated();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue