Skip to content

Display role promotion requests counter on admin > users pages

What does this MR do and why?

Visually this MR does the following:

  • Moves the stats cards from the users tab to be above the tabs
  • Shares the stats cards across the rest of the tabs in the Admin > Users page (i.e. "Role promotions" and "Cohorts")
  • If the role promotions feature is enabled: the role promotions counter will replace the "Administrators" card.

Under the hood this MR does:

  • Extract the stats cards to its own partials
  • In Admin > Users tab: Remove usage of .top-area and use a border class instead

Note: I tried making atomic commits explaining each step.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

- Before After
Users with role promotions feature Screenshot_2024-10-14_at_18.17.34 Screenshot_2024-10-14_at_18.16.17
Users without role promotions feature Screenshot_2024-10-14_at_18.20.11 Screenshot_2024-10-14_at_18.20.39
Role Promotions Screenshot_2024-10-14_at_18.17.16 Screenshot_2024-10-14_at_18.15.18
Cohorts Screenshot_2024-10-14_at_18.17.07 Screenshot_2024-10-14_at_18.16.27

How to set up and validate locally

  1. Have an Ultimate License, and simulate Ultimate Self Managed setup (export GITLAB_SIMULATE_SAAS=0 gdk restart)
  2. Enable the Setting ApplicationSetting.first.update!(enable_member_promotion_management: true)
  3. Enable feature flag Feature.enable(:member_promotion_management)
  4. Create promotion requests:
    1. visit a group as an owner (e.g. http://gdk.test:3000/groups/gitlab-org/-/group_members)
    2. promote a non-billable GUEST member to a DEVELOPER role (this member should be non-billable on the whole instance, i.e. have a highest role as guest, see !149094 (comment 1869616221) for details)
    3. you should see a banner saying "Role change request was sent to the administrator." — this means a promotion request has been created
  5. As root go to Admin area > Users and observe the cards at the top of the page

Related to #470507

Edited by Ammar Alakkad

Merge request reports

Loading