Skip to content

Show Add seats button on Code Suggestions tab only for eligible users

Minahil Nichols requested to merge cdot/8215-add-duo-pro-check into master

What does this MR do and why?

Solves https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/8215

Requires https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9191 to be merged.

Call GraphQL API on CodeSuggestionsInfoCard to get can_add_duo_pro_seats. Show Add seats button based on can_add_duo_pro_seats. If the API fails - show the button anyway.

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.

Screenshots or screen recordings

loading state canAddDuoProSeats = true canAddDuoProSeats = false
image image image

How to set up and validate locally

General setup

Enable the following feature flags in the Rails console (bundle exec rails c):

Feature.enable(:code_suggestions)
Feature.enable(:code_suggestions_tokens_api)
Feature.enable(:purchase_code_suggestions)
Feature.enable(:self_managed_code_suggestions)
Feature.enable(:hamilton_seat_management)

The following feature flags are needed on the Customers App:

  1. Setup and start CustomersDot.
  2. Create or locate a group that is not Free and has duo pro seats.
  3. Visit http://localhost:3000/groups/<GROUP_NAME_ABOVE>/-/usage_quotas#code-suggestions-usage-tab.
  4. You should see the Duo Pro tab and "Add seats" button appear.
  5. Create or locate a group that has duo pro seats and is/has any of the following: ramp, managed by reseller, expired or embargoed.
  6. Visit http://localhost:3000/groups/<GROUP_NAME_ABOVE>/-/usage_quotas#code-suggestions-usage-tab.
  7. You should see the Duo Pro tab and "Add seats" button should not appear.
Edited by Minahil Nichols

Merge request reports