Add API to set membership state

Merged Nicolas Dular requested to merge nd/membership-state-api into master

What does this MR do and why?

  1. Adds an API to change the membership state
  2. Implements the Frontend to toggle the membership state on the usage quota page

Part of:

Screenshots or screen recordings


How to set up and validate locally

  1. Start GDK as if it would be SaaS, start rails console
    gdk start
    bin/rails c
  2. Enable feature flag and use namespace-plans:
    # Set your instance to be on namespace-plans
    ApplicationSetting.first.update(check_namespace_plan: true)
    # Either choose a group that you want for testing. It must be a group on a free-plan
    group = Group.find(ID)
    Feature.enable(:free_user_cap, group)
    # or... enable it for all groups
  3. Go to the group Usage Quota page http://localhost:3000/groups/GROUP_NAME/-/usage_quotas#seats-quota-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.

Edited by Nicolas Dular