Show toggle and tooltips for free namespace limit
What does this MR do and why?
Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/352638
- This shows the toggle to indicate the current state of a membership of a user (being either active or awaiting).
- It disables the the toggle to activate members if the namespace already reached the limit
- It shows the correct amount of users that are billable for free namespaces (using the seats given from the API)
What this MR does not do
- It does not implement the functionality of the toggle (still dependent on the API)
- Fetching membership data from awaiting members fails because we exclude awaiting members in the API right now, this will be done in a separate backend MR (!86432 (merged))
No changelog as it's behind a feature flag free_user_cap
Screenshots or screen recordings
Free Namespace with Limit (this change) | Free namespace without Limit | Namespace on Subscription |
---|---|---|
How to set up and validate locally
export GITLAB_SIMULATE_SAAS=1
gdk start
You want to have three different groups
-
A free group
-
A free group where the Feature flag is enabled
bin/rails c group = Group.find(1) # Use the ID of the group you want to test Feature.enable(:free_user_cap, group)
-
A group on a plan (go to http://localhost:3000/admin/groups, choose a group and set a plan). To be able to do this, you need to enable namespace plans:
bin/rails c ApplicationSetting.first.update(check_namespace_plan: true)
-
For each group, go to the Usage Quota Page: http://localhost:3000/groups/GROUP_NAME/-/usage_quotas#seats-quota-tab
How to activate/deactivate a user
group.members.last.wait # deactivates user
group.members.last.activate
Numbered steps to set up and validate the change are strongly suggested.
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.