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 group if Foo group is pending deletion the API would return Foo group > Bar group.
  • We should consider using archive setting added in #481969 (closed) for this

Implementation guide

  1. Propagate the active parameter on the app/controllers/dashboard/group_controller.rb to the finder.
  2. Ensure that when active is 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