Skip to content

Reimplement search to be more responsive

John Sparger requested to merge reimplement-search into develop

I tried to split the changes into meaningful commits.

  • Create new SearchBar component to replace SearchBoxFilter
  • Increase useTypingTimer default timeout
  • Update useAsync to return loading state
  • Update CustomTable to display loading animation
  • Update all List/Table components to accept loading parameter
  • Update all views previously using SearchBoxFilter to use SearchBar
  • Update all views to pass loading information to SearchBar/Table/List components
  • Create MountEffects hooks for controlling when effects run (only on mount or only after mount)

Increasing the typing timer relates to https://jira.esss.lu.se/browse/ICSHWI-8642. This should make it less likely (though not impossible) to get out of order responses from the backend by reducing the frequency at which queries are made.

Creating SearchBar addresses https://jira.esss.lu.se/browse/ICSHWI-8766. The SearchBar component shows a loading animation while the query is in progress and flashes a check mark when the query completes. This should make the UI feel less frozen during searches.

Updating CustomTable to show a loading animation addresses https://jira.esss.lu.se/browse/ICSHWI-8764. The table no longer shows a loading animation instead of "no records found" while waiting for the initial data to load. It still shows "no records found" when there are 0 results to later queries.

The rest of the changes just facilitate the above. Some noise is in SwaggerApi where it was necessary to wrap many callbacks in useCallback in order to prevent infinite render loops. This should be looked at later to see if we can clean it up.

Edited by John Sparger

Merge request reports