hypothesis / h

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

Show warning when changing existing group between private and public types #8994

Closed robertknight closed 1 month ago

robertknight commented 1 month ago

Show a warning when changing an existing group from a private type to a public type and vice-versa.

A caveat with the current implementation is that once a change is confirmed, it becomes the new "current type" that is used when deciding whether to show the warning in future, even though the type isn't actually changed until "Save changes" is clicked. This made the implementation simpler.

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

Warning when making annotations private:

Make private v2

Warning when making annotations public:

Make public v2

Testing:

  1. Enable the group_type feature flag
  2. Create a new private group
  3. Go to http://localhost:5000/docs/help and add some annotations in the new group
  4. Edit the new group and click the "Open" or "Restricted" group types. You should see a warning. Canceling should abort the change, confirming should perform the change.
  5. Click "Save changes"
  6. Change the group back to "Private". You should see a different warning. Canceling / confirming should work as before.
robertknight commented 1 month ago

If there's only one annotation it says "1 annotations" instead of "1 annotation".

This is now resolved.