mirror of
https://github.com/holos-run/holos.git
synced 2026-03-20 09:15:02 +00:00
This patch adds an organization "selector" that's really just a place holder. The active organization is the last element in the list returned by the GetCallerOrganizations method for now. The purpose is to make sure we have the structure in place for more than one organizations without needing to implement full support for the feature at this early stage. The Angular frontend is expected to call the activeOrg() method of the OrganizationService. In the future this could store the state of which organization the user has selected. The purpose is to return an org id to send as a request parameter for other requests. Note this patch also implements refresh behavior. The list of orgs is fetched once on application load. If there is no user, or the user has zero orgs, the user is created and an organization is added with them as an owner. This is accompished using observable pipes. The pipe is tied to a refresh behavior. Clicking the org button triggers the refresh behavior, which executes the pipe again and notifies all subscribers. This works quite well and should be idiomatic angular / rxjs. Clicking the button automatically updates the UI after making the necessary API calls.