Commit dba73517 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '75-85-fixes' into 'master'

Resolve "Default cursor isn't changing to cursor pointer in the map section on the home page."

Closes #75 and #85

See merge request !29
parents e5c5773f b6d95661
......@@ -138,11 +138,18 @@ public class ExplorerController extends BaseController implements InitializingBe
private List<String> defaultDisplayColumns;
@Value("${paginator.default.maxPageSize}")
private int maxPageSize;
@Override
public void afterPropertiesSet() throws Exception {
validDisplayColumns = genesysService.columnsAvailableForDisplay();
defaultDisplayColumns = genesysService.defaultDisplayColumns();
}
public void setMaxPageSize(int maxPageSize) {
this.maxPageSize = maxPageSize;
}
/**
* Redirect to /explore/c/{shortName} if parameter 'crop' is provided
......@@ -256,7 +263,7 @@ public class ExplorerController extends BaseController implements InitializingBe
_logger.debug(appliedFilters.toString());
}
final Page<AccessionDetails> accessions = filterService.listAccessionDetails(appliedFilters, new PageRequest(page - 1, results, new Sort("seqNo")));
final Page<AccessionDetails> accessions = filterService.listAccessionDetails(appliedFilters, new PageRequest(page - 1, Integer.min(results, maxPageSize), new Sort("seqNo")));
if (_logger.isDebugEnabled()) {
_logger.debug("Got: " + accessions);
......@@ -429,7 +436,7 @@ public class ExplorerController extends BaseController implements InitializingBe
@RequestParam(value = "filter", required = true, defaultValue = "{}") String jsonFilter,
@RequestParam(value = "results", required = true, defaultValue = "50") int results) throws IOException, SearchException {
AppliedFilters appliedFilters = mapper.readValue(jsonFilter, AppliedFilters.class);
return filterService.listAccessionDetails(appliedFilters, new PageRequest(page - 1, results, new Sort("seqNo")));
return filterService.listAccessionDetails(appliedFilters, new PageRequest(page - 1, Integer.min(results, maxPageSize), new Sort("seqNo")));
}
@RequestMapping(value = "/explore/booleanSuggestions", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
......
......@@ -485,7 +485,7 @@ public class AccessionController extends RestController {
}
Page<Accession> accessions = filterService.listAccessions(appliedFilters,
new PageRequest(jsonData.startAt - 1, jsonData.maxRecords, new Sort("acceNumb")));
new PageRequest(jsonData.startAt - 1, Integer.min(jsonData.maxRecords, maxPageSize), new Sort("acceNumb")));
return accessions;
}
......
......@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.genesys2.server.service.impl.RESTApiException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
......@@ -37,6 +38,9 @@ public abstract class RestController {
protected static final ApiResult JSON_OK = new ApiResult(true);
@Value("${paginator.default.maxPageSize}")
protected int maxPageSize;
public static class ApiResult {
public boolean result = false;
......@@ -48,6 +52,10 @@ public abstract class RestController {
public RestController() {
super();
}
public void setMaxPageSize(int maxPageSize) {
this.maxPageSize = maxPageSize;
}
@ExceptionHandler(Exception.class)
@ResponseBody
......
......@@ -15,6 +15,7 @@
#-------------------------------------------------------------------------------
#Paginator
paginator.default.maxPageSize=500
paginator.default.pageSize=50
paginator.default.fastStep=3
paginator.default.maxPage=4
......
......@@ -411,6 +411,7 @@ $light-font-family: 'Roboto-Light';
background-size: cover;
background-position: 101.5%;
height: 305px;
cursor: pointer;
}
#stats {
background: transparent;
......
......@@ -15,6 +15,7 @@
#-------------------------------------------------------------------------------
#Paginator
paginator.default.maxPageSize=500
paginator.default.pageSize=2
paginator.default.fastStep=3
paginator.default.maxPage=4
......
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