Skip to content

Add ability to filter Add-ons by group

Angelo Gulina requested to merge ag/425232-add-filter-by-group into master

What does this MR do and why?

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

This relates to https://gitlab.com/gitlab-org/gitlab/-/issues/425232. This is the last MR of a group that aimed at introducing group-based filtering for Duo Pro users. (The backend is not yet implemented. Here, we're providing only frontend scaffolding/implementation.)

Currently, searching for a group would always show the main group together with any matching (sub)groups. I think we could improve this, but I'll probably make it a separate iteration. Letting ~UX decide on this.

Note that the feature does not impact current UI, as the FF is disabled.

Description MR
Use processFilters instead of custom method !141975 (merged)
Make filters options (tokens) configurable for SaaS/SM user list !142015 (merged)
Add ability to filter add-on users by group 👈

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Group filter Group filter with selected group Group filter with subgroups Group filter with search
Screenshot_2024-01-23_at_17.02.31 Screenshot_2024-01-23_at_17.02.37 Screenshot_2024-01-23_at_17.06.58 Screenshot_2024-01-23_at_17.26.08

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Needs both gdk and CustomersDot running (setup guide)
  2. In Rails console, enable Code Suggestions Feature.enable(:hamilton_seat_management)
  3. In Rails console, enable the filtering capabilities Feature.enable(:enable_add_on_users_filtering)

To assign Code Suggestions seats to your group:

  1. In Rails console, add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
  2. In Rails console, GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, namespace: Namespace.find(<you-name-space-id>), expires_on: 21.month.from_now, quantity: 5, purchase_xid: 'A-S0002')
  3. Visit any group or project member pages such as http://127.0.0.1:3000/groups/flightjs/-/usage_quotas#code-suggestions-usage-tab
Edited by Angelo Gulina

Merge request reports