Skip to content

Use exclude_guests on overage check

Diana Zubova requested to merge dz/353455-call-exclude-guests-on-overage into master

What does this MR do and why?

For the existing check_overage pass a role (Guest/Developer/Reporter etc) of the member/group to be added and exclude_guests from API.

If a role is Guest and the plan type is exclude guests - return no overage. Otherwise, follow the standard rules for overage

Step MR
Extend API with exclude_guests !84069 (merged)
Fetch this API to conditionally show overage modal when adding members/groups to a group 👈 you are here

Related to #353455 (closed)

Screenshots or screen recordings

With overage Without overage
Screen_Recording_2022-04-06_at_15.18.44 Screen_Recording_2022-04-06_at_15.19.50

How to set up and validate locally

  1. Enable the invite modal
    Feature.enable(:overage_members_modal)
  2. Make sure that you are running GitLab as SaaS and have check_namespace_plan setting enabled
    ::Gitlab::CurrentSettings.update(check_namespace_plan: true)
  3. Create a group, add a premium subscription for one seat
  4. Visit this group page, then Group Information -> Members http://localhost:3000/groups/<your-group>/-/group_members.
  5. Click the Invite member or Invite group button.
  6. Add a member or group in a dropdown, choose role and click Invite.
  7. Check the modal.

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 Diana Zubova

Merge request reports