Show "Leave group" option for open and restricted groups that user is a member of #6638
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.
Previously the "Leave group" option was only shown for private groups on the basis that membership of open and restricted groups was managed by h admins. However first-party Hypothesis users can now create open and restricted groups themselves and members of these groups will see an option to leave the group on activity pages. Align whether the client shows the "Leave group" option with h's behavior.
During this change it was noticed that the documentation in the code and test descriptions did not match the actual handling of
allowLeavingGroups
. The comments said that services had to explicitly setallowLeavingGroups
to prevent users leaving. However the code would treatallowLeavingGroups
as false if a) service configuration was present and b) the value ofallowLeavingGroups
was falsey (including undefined). Changing this behavior may cause issues for existing users of third party authorities, so this commit updates the documentation and tests to accurately describe the current behavior.Fixes #6637 (Slack thread)
Testing:
main
branch in the client, the new group will appear in the drop-down menu but the "Leave group" option will be missing