Investigations fetching needs refactoring
At the moment, when the app loads, all the investigations a user has access to are fetched and stored in memory. For admins, this amounts to lot of data and leads to the manager menu showing a spinner for a long time as reported in #347 (closed).
This behaviour was required because of the count badges in the navbar. If we get rid of the badges, we no longer have to fetch everything at once. We can fetch only the investigations that we need, when we need them (e.g. fetch only open data collection when lending on the "Open Data" page).
Until now we also relied on this all-at-once fetching for displaying even just a single investigation. This can be improved by making use of endpoint /catalogue/{sessionId}/investigation/id/{investigationId}/investigation
which allows fetching a single investigation.
The goal of this issue is therefore to:
- remove the count badges in the navbar;
- use Rest Hooks to fetch investigations where needed, and when needed.
For this refactor to be easier, the endpoints to fetch lists of investigations (datacollection, embargoed, beamline, etc.) should be combined into a single endpoint. I'll open an issue for this on icat-plus
. => icat-plus#185 (closed)