Fix user cap alert on non-namespace pages
What does this MR do and why?
When a page is not within a namespace and we try to display the
namespace user cap alert, we would receive an error for building the
pending_members_group_usage_quotas_path
.
We need to use .persisted?
because by default, we build a new
Namespace record and pass it along to the frontend.
Screenshots or screen recordings
How to set up and validate locally
export GITLAB_SIMULATE_SAAS=1
gdk start
- Enable free_user_cap as feature flag globally
bin/rails c Feature.enable(:free_user_cap)
- Go to http://localhost:3000/groups/new
- See the error (without this fix)
Reason is that we reuse the user_cap_available?
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.