Show Add seats button on Code Suggestions tab only for eligible users
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 |
---|---|---|
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:
- Setup and start CustomersDot.
- Create or locate a group that is not Free and has duo pro seats.
- Visit
http://localhost:3000/groups/<GROUP_NAME_ABOVE>/-/usage_quotas#code-suggestions-usage-tab
. - You should see the
Duo Pro
tab and "Add seats" button appear. - Create or locate a group that has duo pro seats and is/has any of the following: ramp, managed by reseller, expired or embargoed.
- Visit
http://localhost:3000/groups/<GROUP_NAME_ABOVE>/-/usage_quotas#code-suggestions-usage-tab
. - You should see the
Duo Pro
tab and "Add seats" button should not appear.
Edited by Minahil Nichols