• Robert Knight's avatar
    Show "Leave group" option for open and restricted groups that user is a member of · d14c255b
    Robert Knight authored
    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 set `allowLeavingGroups` to
    prevent users leaving. However the code would treat `allowLeavingGroups` as false
    if a) service configuration was present and b) the value of `allowLeavingGroups`
    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 https://github.com/hypothesis/client/issues/6637
    d14c255b
groups.ts 3.63 KB