Add pending SaaS users to "Invited" members tab [RUN AS-IF-FOSS]
What does this MR do and why?
Relates to: #334288 (closed)
With the User Cap setting, admins can prevent accidental user overages, so when the group is at limit of number of users, they should be on the invited tab, with Pending Owner Approval status (a badge will be added here: !70682 (merged))
Screenshots or screen recordings
Group Members
| Before | After | 
|---|---|
|  |  | 
Project Members
| Before | After | 
|---|---|
|  |  | 
How to set up and validate locally
Enable User Cap
- Activate Feature Flag using rails c- my_group = Group.find(<group_id>)
- Feature.enable(:saas_user_caps, my_group)
 
- On the same rails consolesession, check user cap- 
my_group.user_cap_reached?. Output should befalse
- my_group.namespace_settings.update!(new_user_signups_cap: my_group.group_members.count)
- 
my_group.user_cap_reached?. Output should betrue
 
- 
Add members
- Go to the browser, and navigate to groups/my_group/-/group_members
- Add a new member (e.g. @valeriafrom the seeded data)
Behavior
- Before: The new user would appear in the "Members" tab
- With this MR: The new user appears in the invited tab
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 Etienne Baqué