Commit 47263d88 authored by Matija Obreza's avatar Matija Obreza

Merge branch '397-appliedfiltersconverter-for-sciname' into 'master'

Resolve "AppliedFiltersConverter for sciName"

Closes #397

See merge request genesys-pgr/genesys-server!320
parents bcba3ad5 57b981e7
......@@ -151,7 +151,7 @@ public class Pagination {
* @return the pageable
*/
public Pageable toPageRequest(int maxPageSize) {
return new PageRequest(p == null ? 0 : p, Integer.min(l == null ? 100 : l, maxPageSize), getDirection(Sort.Direction.ASC), getSortProperties(DEFAULT_SORT_PROPERTIES));
return new PageRequest(p == null ? 0 : p, Integer.min(l == null ? maxPageSize : l, maxPageSize), getDirection(Sort.Direction.ASC), getSortProperties(DEFAULT_SORT_PROPERTIES));
}
/**
......@@ -163,7 +163,7 @@ public class Pagination {
* @return the pageable
*/
public Pageable toPageRequest(int maxPageSize, Direction defaultDir, String... defaultSort) {
return new PageRequest(p == null ? 0 : p, Integer.min(l == null ? 100 : l, maxPageSize), getDirection(defaultDir), getSortProperties(defaultSort));
return new PageRequest(p == null ? 0 : p, Integer.min(l == null ? maxPageSize : l, maxPageSize), getDirection(defaultDir), getSortProperties(defaultSort));
}
/**
......@@ -174,7 +174,7 @@ public class Pagination {
* @return the pageable
*/
public static Pageable toPageRequest(int maxPageSize, Sort sort) {
return new PageRequest(0, Integer.min(100, maxPageSize), sort);
return new PageRequest(0, maxPageSize, sort);
}
}
......@@ -141,7 +141,7 @@ public class DatasetController extends ApiBaseController {
*/
@GetMapping("/{metadataId}/accessions")
public Page<AccessionRef> listAccessions(@PathVariable("metadataId") long metadataId, Pagination pagination) {
return genesysService.listMetadataAccessionRefs(metadataId, pagination.toPageRequest(50, Direction.ASC, "a.id"));
return genesysService.listMetadataAccessionRefs(metadataId, pagination.toPageRequest(1000, Direction.ASC, "a.id"));
}
/**
......
......@@ -66,7 +66,7 @@ public class AppliedFiltersConverter {
case FilterConstants.REGION_ORIGIN:
return "countryOfOrigin.region.isoCode";
case FilterConstants.TAXONOMY_SCINAME:
return "taxonomy.taxon";
return "taxonomy.taxonName";
case FilterConstants.SGSV:
case FilterConstants.IN_SGSV:
return ACCEFILT_SGSV;
......@@ -397,7 +397,8 @@ public class AppliedFiltersConverter {
ff.subtaxa = convertStringFilter(af);
break;
}
case "taxon": {
case "taxon":
case "sciName": {
ff.taxon = convertStringFilter(af);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment