Small fixes on Project's endpoint listing.
This commit is contained in:
parent
e829c5e6f0
commit
8b77ab759a
|
@ -174,6 +174,11 @@ public class ProjectListingModel implements DataModel<eu.eudat.data.entities.Pro
|
|||
public ProjectListingModel fromDataModel(eu.eudat.data.entities.Project entity) {
|
||||
this.id = entity.getId();
|
||||
this.label = entity.getLabel();
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProjectListingModel fromDataModelWIthDmps(eu.eudat.data.entities.Project entity) {
|
||||
this.fromDataModel(entity);
|
||||
this.abbreviation = entity.getAbbreviation();
|
||||
this.reference = entity.getReference();
|
||||
this.uri = entity.getUri();
|
||||
|
@ -185,11 +190,6 @@ public class ProjectListingModel implements DataModel<eu.eudat.data.entities.Pro
|
|||
this.modified = entity.getModified();
|
||||
this.description = entity.getDescription();
|
||||
this.files = entity.getContent() != null ? Arrays.asList(new ContentFile(entity.getContent().getLabel(), UUID.fromString(entity.getContent().getUri().split(":")[1]), "final", entity.getContent().getExtension())) : Arrays.asList(new ContentFile("default.png", null, null, null));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProjectListingModel fromDataModelWIthDmps(eu.eudat.data.entities.Project entity) {
|
||||
this.fromDataModel(entity);
|
||||
this.dmps = entity.getDmps().stream().map(item -> new DataManagementPlanUrlListing().fromDataModel(item)).collect(Collectors.toList());
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ export class ProjectService {
|
|||
this.actionUrl = environment.Server + 'projects/';
|
||||
}
|
||||
|
||||
getPaged(dataTableRequest: DataTableRequest<ProjectCriteria>,fieldsGroup?: string): Observable<DataTableData<ProjectListingModel>> {
|
||||
if(fieldsGroup){
|
||||
getPaged(dataTableRequest: DataTableRequest<ProjectCriteria>, fieldsGroup?: string): Observable<DataTableData<ProjectListingModel>> {
|
||||
if (fieldsGroup) {
|
||||
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
else{
|
||||
else {
|
||||
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue