Skip to content

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 info alert if the approval succeeds, and a danger alert 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_before approve_button_pending_members_after

How to set up and validate locally

  1. Set Gitlab.com? to return true by changing lib/gitlab.rb
  2. Enable saas_user_caps feature flag from rails console. (rails console then Feature.enable(:saas_user_caps))
  3. With a group with an Ultimate plan
  4. Navigate to Settings -> Permissions, LFS, 2FA -> User Cap
  5. Set the user cap limit to 1
  6. Navigate to the group members
  7. Add one or more members (until you are above the user cap limit set in previous step)
  8. Navigate to Usage Quota from the left sidebar under Settings
  9. You should see an alert that you have pending members
  10. Clicking the button in the alert should navigate to a pending members page
  11. Approve the members you want.
  12. They should now be moved from the invited tab to the members tab 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.

Edited by Sheldon Led

Merge request reports