Skip to content

Add Service to set members to awaiting

Nicolas Dular requested to merge nd/add-deactivate-member-api into master

What does this MR do and why?

This Service will be used to set memberships to awaiting. The opposite service already exists with Members::ActivateService. It handles the case to change Group and Project Membership state for a user.

The service will be used for the API to toggle the membership state.

Related Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/352638

How to set up and validate locally

bin/rails c

group = Group.first
user = group.members.last.user
puts g.members.last.user.awaiting? # => false

::Members::AwaitService.new(group, user: user, current_user: User.first).execute

puts g.members.last.user.awaiting? # => true

How to check in the UI: In http://localhost:3000/groups/GROUP_NAME/-/usage_quotas#seats-quota-tab the user should no longer be visible. However, they appear now in the "invited" tab in http://localhost:3000/groups/GROUP_NAME/-/group_members?tab=invited

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 Nicolas Dular

Merge request reports

Loading