Add "Approve" button to pending members table
What does this MR do and why?
Relates to #330027 (closed)
This adds an approve button to the Pending Members table. A few implementation details
- We don't refetch the user list after approving to save one extra call to the backend
- Users that have been approved but are pending registration will still appear in the list (this comes from the backend API)
- We show an
infoalert if the approval succeeds, and adangeralert if it fails. Both alerts in the same location in the UI (shown in the video below)
Screenshots or screen recordings
Note: In the first approval try I force a server side error so we can see the error alert.
| Before | After |
|---|---|
![]() |
approve_button_pending_members_after |
How to set up and validate locally
- Set
Gitlab.com?to return true by changinglib/gitlab.rb - Enable
saas_user_capsfeature flag from rails console. (rails consolethenFeature.enable(:saas_user_caps)) - With a group with an Ultimate plan
- Navigate to
Settings->Permissions, LFS, 2FA->User Cap - Set the user cap limit to
1 - Navigate to the group members
- Add one or more members (until you are above the user cap limit set in previous step)
- Navigate to
Usage Quotafrom the left sidebar underSettings - You should see an alert that you have pending members
- Clicking the button in the alert should navigate to a pending members page
- Approve the members you want.
- They should now be moved from the
invitedtab to thememberstab in the group's members page
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 Sheldon Led
