Adds ordering on Published Dataset Descriptions listing (descending by published date). (Issue #174)
This commit is contained in:
parent
812891fed1
commit
f93b6103e9
|
@ -141,6 +141,9 @@ public class DatasetManager {
|
||||||
} else
|
} else
|
||||||
items.where((builder, root) -> root.get("id").in(new UUID[]{UUID.randomUUID()}));
|
items.where((builder, root) -> root.get("id").in(new UUID[]{UUID.randomUUID()}));
|
||||||
}
|
}
|
||||||
|
String[] strings = new String[1];
|
||||||
|
strings[0] = "-dmp:publishedAt|join|";
|
||||||
|
datasetTableRequest.getOrderings().setFields(strings);
|
||||||
QueryableList<eu.eudat.data.entities.Dataset> pagedItems = PaginationManager.applyPaging(items, datasetTableRequest);
|
QueryableList<eu.eudat.data.entities.Dataset> pagedItems = PaginationManager.applyPaging(items, datasetTableRequest);
|
||||||
DataTableData<DatasetListingModel> dataTable = new DataTableData<>();
|
DataTableData<DatasetListingModel> dataTable = new DataTableData<>();
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
private String grantAbbreviation;
|
private String grantAbbreviation;
|
||||||
private String grantId;
|
private String grantId;
|
||||||
private Date finalizedAt;
|
private Date finalizedAt;
|
||||||
|
private Date dmpPublishedAt;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -140,6 +141,13 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
this.finalizedAt = finalizedAt;
|
this.finalizedAt = finalizedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getDmpPublishedAt() {
|
||||||
|
return dmpPublishedAt;
|
||||||
|
}
|
||||||
|
public void setDmpPublishedAt(Date dmpPublishedAt) {
|
||||||
|
this.dmpPublishedAt = dmpPublishedAt;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetListingModel fromDataModel(Dataset entity) {
|
public DatasetListingModel fromDataModel(Dataset entity) {
|
||||||
this.id = entity.getId().toString();
|
this.id = entity.getId().toString();
|
||||||
|
@ -158,6 +166,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
this.dataRepositories = LabelBuilder.getLabel(entity.getDatasetDataRepositories().stream().map(item -> new DataRepository().fromDataModel(item.getDataRepository())).collect(Collectors.toList()));
|
this.dataRepositories = LabelBuilder.getLabel(entity.getDatasetDataRepositories().stream().map(item -> new DataRepository().fromDataModel(item.getDataRepository())).collect(Collectors.toList()));
|
||||||
this.services = LabelBuilder.getLabel(entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList()));
|
this.services = LabelBuilder.getLabel(entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList()));
|
||||||
this.finalizedAt = entity.getFinalizedAt();
|
this.finalizedAt = entity.getFinalizedAt();
|
||||||
|
this.dmpPublishedAt = entity.getDmp().getPublishedAt();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,5 @@ export interface DatasetListingModel {
|
||||||
created: Date;
|
created: Date;
|
||||||
modified: Date;
|
modified: Date;
|
||||||
finalizedAt: Date;
|
finalizedAt: Date;
|
||||||
|
dmpPublishedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<div class="pt-1">
|
<div class="pt-1">
|
||||||
<div matTooltip="{{ dataset.profile }}" class="chip ml-2 mr-2">{{ dataset.profile }}</div>
|
<div matTooltip="{{ dataset.profile }}" class="chip ml-2 mr-2">{{ dataset.profile }}</div>
|
||||||
</div>
|
</div>
|
||||||
<p>{{'DATASET-LISTING.COLUMNS.PUBLISHED' | translate}} {{dataset.created | date: "shortDate"}}</p>
|
<p>{{'DATASET-LISTING.COLUMNS.PUBLISHED' | translate}} {{dataset.dmpPublishedAt | date: "shortDate"}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="info">
|
<!-- <div class="info">
|
||||||
|
|
Loading…
Reference in New Issue