Add filter support to /dashboard/groups.json for inactive groups
Background
For &13781 (closed) we want an Inactive groups tab. In short term this tab will show groups pending deletion, but when we introduce group archiving this tab will also show archived groups.
Proposal
- Add a new parameter to
/dashboard/groups.json(Dashboard::GroupsController#index) that can filter by groups pending deletion and groups not pending deletion - The tree should start at the highest group pending deletion. For example in
Top-level group>Foo group>Bar groupifFoo groupis pending deletion the API would returnFoo group>Bar group. - We should consider using
archivesetting added in #481969 (closed) for this
Implementation guide
- Propagate the
activeparameter on theapp/controllers/dashboard/group_controller.rbto the finder. - Ensure that when
activeis set, we only return groups that matches the filter.- If multiple matched groups belong in the same tree, they should be merged in the same hierarchy.
- Upper-level groups that don't match the filter shouldn't be shown.
- See #525633 (closed) for reference
Expected usage
- Inactive only:
/dashboard/groups.json?active=false - Active only:
/dashboard/groups.json?active=true
Edited by Shane Maglangit