hypothesis / h

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

Add "Group type" field to group creation form #8993

Closed robertknight closed 1 month ago

robertknight commented 1 month ago

This allows setting the group type to "private", "restricted" or "open" when creating or editing a group.

This PR does not implement the part of the design where a warning is shown when changing the type of an existing group.

See https://github.com/hypothesis/h/issues/8898.

Testing:

  1. Enable the group_type feature flag
  2. Go to http://localhost:5000/groups/new
  3. You should see new UI options to set the group type
  4. Pick one of the group types other than "Private" and create the group
  5. Go to edit the group and you should see the chosen group type selected
  6. Change the group type in the edit form and click "Save changes"
  7. Refresh the page and the group type should persist
seanh commented 1 month ago

One issue I noticed: if a confirmation tick is shown next to the Save changes button because a previous change has already been saved, then changing the selected radio box doesn't clear the tick like changing one of the text fields does. This means you end up clicking Save changes when the tick is already still present which is a little weird.

robertknight commented 1 month ago

One issue I noticed: if a confirmation tick is shown next to the Save changes button because a previous change has already been saved, then changing the selected radio box doesn't clear the tick like changing one of the text fields does.

Ah, the form's save state is not reset. I'll address this as part of https://github.com/hypothesis/h/pull/8994.