SearchContext refactor and optimization of API queries made by the GUI
- Now the GUI employs the refactored API queries that include the
exclude_from_search
parameter. In practice, this means that the requests for search results and aggregations are now done with a single API call (whereas previously there was a separate API call for each statistic shown on screen). - Fixed API issue with
models.Range
queries inside nested dictionaries, added new API tests for such cases. - Moved the registration of search filters into a separate file:
FilterRegistry.js
- Completely refactored
SearchContext
: API calls are now optimized based on the changed filters and required aggregations. EachSearchContext
now has a completely separate state: this also means that multipleSearchContext
s can be kept alive simultaneously. - The three search pages (entry search, material search, own data search) are now cached using
react-router-cache-route
library. Caching can be enabled individually for each page and also the caching direction can be specified (e.g. cache only when going forward in browser history state). The library works by simply using theCacheRoute
component instead of the traditionalRoute
component fromreact-router-dom
. The benefits of caching become most evident when quickly navigating between the search page and individual entry pages.
Edited by Lauri Himanen