Repository navigation
feat(teams): several owners per team, and a primary owner who can hand over (#652) - #657
Merged
Merged
Conversation
…d over (#652) Owners now see the Owner role in a member's roles and can grant or remove it, after a confirmation. A co-owner is no longer out of an Owner's reach: they can be removed, and can leave on their own. The team's creator becomes the primary owner, the account billing sits on. The member panel says so, explains that they must hand it over before leaving, and offers "Make primary owner" on another Owner. On a self-hosted server any Owner may do that. On the cloud only the primary owner may, and the confirmation says the new owner's own subscription pays from then on. The controls appear only when the server advertises multi_owner, so an older server keeps the single-owner behaviour. The ownership rules live in a pure memberOwnership model shared by the roster and the panel. isTeamOwner is renamed isPrimaryOwner, since owner_id now means exactly that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #652. Needs VoltiusApp/server#114.
What changes
teams.owner_id) is shown as the primary owner in an "Ownership" section. Billing is attached to that account, and only it can delete the team.multi_ownerfrom/v1/meta. Against an older server the panel behaves as before.Code
services/teamOwnership.ts: purememberOwnership(ctx, target). Decides protected / leave / grant Owner / make primary. The roster and the panel both use it.hooks/useOwnershipContext.ts: reads the server capabilities, the team'sowner_idand the viewer's roles into that context.teamService.transferBillingOwner+teamStore.transferBillingOwner, then reload the teams list.isTeamOwneris renamedisPrimaryOwner. Existing callers (delete team, make private, business-lock banner) already meant that.Tests
teamOwnership.test.ts: the rules, including the cloud vs self-hosted transfer and old-server fallback.MemberDetailPanel.ownership.test.tsx: Owner chip shown to Owners only, grant asks first, primary owner protected, transfer offered per mode, leave rules.Checked live
The app ran headless against a local build of server#114 (self-hosted). On it I granted Owner to a Manager, made another Owner primary, and checked the old primary owner then gets "Leave team". The server state matched after each step. I also took phone-width captures with the Android shell forced in the desktop build; those are layout only, not a device run.
Not here