Add title and subtitle to Code Suggestions admin page
What does this MR do and why?
Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/436407. Adds a title and subtitle to the Code Suggestions Admin Page in Self-Managed instances, as per this Figma design.
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
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Case | Before | After |
---|---|---|
Code suggestions add-on purchased | ![]() |
![]() |
Code suggestions add-on not purchased | ![]() |
No change |
How to set up and validate locally
Pre-testing setup
- Start GDK in Self-Managed mode using
GITLAB_SIMULATE_SAAS=0 gdk start
(this is the default mode). - 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)
- Log into GDK using your
root
user. - Ensure you have a valid paid license (Premium or Ultimate) through Admin Area > Subscriptions.
Testing without Code Suggestions add-on
- Navigate to
gdk.test:3000/admin/code_suggestions
. - Verify that there is no change to the UI (see screenshots).
Testing with Code Suggestions add-on
- Purchase a "Self-Managed - Duo Pro" add-on from the Zuora API Sandbox, or spoof one using the following commands in the Rails console:
# Feel free to delete these objects after testing
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(
add_on: add_on, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001'
)
add_on_purchase.update(expires_on: 1.month.from_now)
- Navigate to
gdk.test:3000/admin/code_suggestions
. - Verify that the Code Suggestion page full UI has a title and subtitle present.
Edited by Mohamed Moustafa