Show code suggestions add-on details in users list
What does this MR do and why?
Show code suggestions add-on details in users list on usage quotas page
- Create a new component
code_suggestions_addon_assignment.vue
- Read-only view of current addon assignment to begin with
- Only shows code suggestions add-on field when applicable
- Added tests for logic around visibility of new field
- Added tests for new component
When enable_hamilton_in_usage_quotas_ui
feature flag is enabled, currently all toggles are displayed in OFF state while API changes are being made.
Related to #411949
Screenshots or screen recordings
enable_hamilton_in_usage_quotas_ui
enabled
With Scenario | Screenshot |
---|---|
Paid subscription and add-on purchase exists (Ultimate or Premium) | |
With dummy data for enabled - on and off and disabled states | |
Code suggestions add-on unavailable tooltip | |
Error when loading Code Suggestions add-on details | |
Paid subscription exists but no add-on purchase exists | |
No paid subscription exists |
enable_hamilton_in_usage_quotas_ui
disabled
With Scenario | Screenshot |
---|---|
Paid subscription exists | |
No paid subscription exists |
How to set up and validate locally
- Customers Dot needs to be setup in order to view the billing page for a group
- Start GDK in SaaS mode
GITLAB_SIMULATE_SAAS=1 gdk start
- Enable
enable_hamilton_in_usage_quotas_ui
FF (globally, or for your group) - Create a Group
- Buy a Subscription for your group from
Settings
>Billing
- Visit
/groups/<your-namespace-name>/-/usage_quotas#seats-quota-tab
Dummy data to show add-on details
Add the below snippet here. Note that the number of users in the user list should at least be the number of items in the below dummy snippet (3). You can adjust the dummy snippet as you need.
state.members[0].add_ons = {
assigned: [{ name: 'CODE_SUGGESTIONS' }],
assignable: [{ name: 'CODE_SUGGESTIONS' }],
};
state.members[1].add_ons = { assigned: [], assignable: [{ name: 'CODE_SUGGESTIONS' }] };
state.members[2].add_ons = { assigned: [], assignable: [] };
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.
Edited by Vamsi Vempati