Allow groups with no scopes in admin pages #9011
Merged
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.
Problem
Previously the only way to create open or restricted groups was via the
https://hypothes.is/admin/groups/new admin page and that page forced you
to enter at least one scope for the group.
It's now possible to use the https://hypothes.is/groups/new page to
create open and restricted groups with no scopes.
But the
https://hypothes.is/admin/groups/<PUBID>
page for editing anexisting open or restricted group forces the group to have at least one
scope.
This means that if you create an unscoped group via
https://hypothes.is/groups/new and then try to edit the group via
https://hypothes.is/admin/groups/<PUBID>
it'll force you to enter atleast one scope for the group before you can save any changes (even to
other fields, e.g. the group's name).
Solution
Remove the admin pages validation requirement that groups must have at
least one scope. Now you can edit unscoped groups without having to add
a scope to them.
As a side-effect https://hypothes.is/admin/groups/new can now be used to
create unscoped groups as well.
Testing
Go to either https://hypothes.is/admin/groups/new or
https://hypothes.is/groups/new, create an open or restricted group, then
go to
https://hypothes.is/admin/groups/<PUBID>
and edit the groupwithout adding any scopes to it.