Recidiviz / justice-counts

Technical infrastructure for the Justice Counts initiative
GNU General Public License v3.0
2 stars 0 forks source link

[Publisher][Admin Panel] Add spinner when user agencies and team member list is loading #1526

Closed mxosman closed 1 month ago

mxosman commented 1 month ago

We've made some adjustments to the UI for the admin panel in order to speed it up as the list of users and agencies using Publisher is scaling up substantially. This involved fetching a list of users/agencies only when an agency/user card is clicked. Right now, when you click on a user card in the User Provisioning section, the UI displays "User has no agencies" until the list of agencies is fetched and received. Similarly (though hard to see since it's in a separate tab), when you click on an agency card and go to the Team Members & Roles tab, you'll see no users loaded until the list is fetched and received.

During the fetch, we should add a loading spinner (specifically the MiniLoader in the common repo) within the list of agencies box and on the Team Members & Roles section (under the Add Users and Delete Users button) until a response is received and the list is populated.

mxosman commented 1 month ago

Hi @nasaownsky!! Can I ask you to prioritize this one please as it's become higher priority?

It should hopefully be super straight forward - my recommendation is adding a userAgenciesLoading and teamMemberListLoading properties to the AdminPanelStore and initialize both of them as true, and setting them to false within the runInAction in both the fetchAgencyTeam and fetchUserAgencies after the agenciesByID and usersByID are set. Then updating the UI to read from those fields. Also - feel free to go with any other solution you think is best!