When a user logs in, we should cache minimal data about the facilities so that other services and APIs don't have to fetch simple data such as facility name and UUID.
When logged in, UI fetches and saves list of facilities
When the UI loads, and there is no list of facilities, the UI will download the facilities
When user logs out, the list of facilities is removed from local storage
I've just pushed the first bit of this functionality (it doesn't currently clear data when you logout)
Here is how you get the cached minimal facilities list
short answer, pretend you are getting it from the server – if there is a cached copy, it will return that list – otherwise it will make a http request and such like
If I were you, I'd add this to the routers resolve
Bug if you don't know what I'm talking about (and he might complain about how vague I am) XD
please take a look at Nick's comment.
– lets chat today about how to test this, because there is nothing that should be distinctly user visible about this ticket....
Tested on test in both Firefox and Chrome. Checked localStorage openlmis.referencedataMinimalFacilities and on login, the facilities were populated. On logout, the facilities are emptied. Moving this to Done.