hypothesis / h

Annotate with anyone, anywhere.
https://hypothes.is/
BSD 2-Clause "Simplified" License
2.95k stars 426 forks source link

Frontend: enable users to create restricted and open groups #8898

Closed seanh closed 3 weeks ago

seanh commented 2 months ago

Requires feature flag.

Implement the frontend (user interface and API call) to enable users to create restricted and open groups and to change the types of existing groups between private, restricted and open.

Part of ERD: Creating Restricted and Open Groups.

Depends on the backend API: https://github.com/hypothesis/h/issues/8896

Create group page

Here's the desired new design for the create-group page:

Image

Changes:

Edit group page

Here's the desired new design for the edit-group page:

Image

Changes:

API call

Warning when changing the type of an existing group

When an existing private group is changed to open/restricted or vice-versa this changes the visibility of any pre-existing shared annotations in the group: annotations that were previously only visible to members of the group will now be publicly visible or vice-versa. We want to show the user a warning before letting them do this.

Design for the warning dialog (note: not the final wording): image

Final wording (see Slack thread):

Make 100 annotations public?

Are you sure you want to make "My Group" an open group? 100 annotations that are visible only to members of My Group will become publicly visible.

Alternative text when changing an open or restricted group to private:

Make 100 annotations private?

Are you sure you want to make "My Group" a private group? 100 annotations that are publicly visible will become only visible to members of My Group.

seanh commented 2 months ago

I've added the type of the existing group to the js-config on the group-edit page so the frontend can know which radio box should be selected initially: https://github.com/hypothesis/h/pull/8911

Also added the number of shared annotations and replies in the group, which'll be needed for the warning dialog: https://github.com/hypothesis/h/pull/8939