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
|
||||
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);
|
||||
DataTableData<DatasetListingModel> dataTable = new DataTableData<>();
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
|||
private String grantAbbreviation;
|
||||
private String grantId;
|
||||
private Date finalizedAt;
|
||||
private Date dmpPublishedAt;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -140,6 +141,13 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
|||
this.finalizedAt = finalizedAt;
|
||||
}
|
||||
|
||||
public Date getDmpPublishedAt() {
|
||||
return dmpPublishedAt;
|
||||
}
|
||||
public void setDmpPublishedAt(Date dmpPublishedAt) {
|
||||
this.dmpPublishedAt = dmpPublishedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetListingModel fromDataModel(Dataset entity) {
|
||||
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.services = LabelBuilder.getLabel(entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList()));
|
||||
this.finalizedAt = entity.getFinalizedAt();
|
||||
this.dmpPublishedAt = entity.getDmp().getPublishedAt();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,4 +15,5 @@ export interface DatasetListingModel {
|
|||
created: Date;
|
||||
modified: Date;
|
||||
finalizedAt: Date;
|
||||
dmpPublishedAt?: Date;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="pt-1">
|
||||
<div matTooltip="{{ dataset.profile }}" class="chip ml-2 mr-2">{{ dataset.profile }}</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 class="info">
|
||||
|
|
Loading…
Reference in New Issue