Skip to content

SearchContext refactor and optimization of API queries made by the GUI

Lauri Himanen requested to merge aggregation-improvement-gui into v1.0.0
  • 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. Each SearchContext now has a completely separate state: this also means that multiple SearchContexts 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 the CacheRoute component instead of the traditional Route component from react-router-dom. The benefits of caching become most evident when quickly navigating between the search page and individual entry pages.
Edited by Lauri Himanen

Merge request reports