Add Intro section to Code Suggestions Tab
What does this MR do and why?
Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/422629. With this MR we are introducing an empty state for the Code Suggestions tab, for when there is no purchased Add-on. Other states will be introduced with follow-up work. Note that the empty state is missing an illustration. It will be added with: https://gitlab.com/gitlab-org/gitlab/-/issues/423350
This MR also refactors a bit of code to make the location of some files consistent with the new tab approach.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Condition | Expectation | Screenshot |
---|---|---|
In SM Mode | ||
No tab should appear | ||
In SaaS mode | ||
-- With Feature flag disabled for group | ||
No tab should appear | ||
-- With Feature flag enabled for group | ||
---- With no purchased add-on data | ||
Shows empty state | ||
---- With purchased add-on data | ||
Shows nothing | ||
---- With an error in the add-on data request | ||
Shows empty state |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
In your rails console:
- Customers Dot needs to be setup in order to view the billing page for a group
Feature.enable(:enable_hamilton_in_usage_quotas_ui, Namespace.find(your-group-id)
Group with subscription
- Create a Group
- Buy a Subscription for your group from
Settings
>Billing
Purchase Add-on
Run the following in Rails console:
- Find the namespace
namespace = Namespace.find(your-group-id)
- Create an Addon
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
- Create an add-on purchase
GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, namespace: namespace, expires_on: 1.month.from_now, quantity: 20, purchase_xid: 'A-S0001')
SaaS mode
- Start GDK in SaaS mode
GITLAB_SIMULATE_SAAS=1 gdk start
SM mode
- Start GDK in SM mode
GITLAB_SIMULATE_SAAS=0 gdk start
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.