Skip to content

Add pagination to members Pending promotion tab

Kos Palchyk requested to merge 433174-add-pagination into master

What does this MR do and why?

This is a third step in #433174 (closed), it adds pagination to the Promotions tab component.

Here's the MR plan

this MR MR plan status
Custom Component for the tab workflowcomplete
Custom store or Apollo store workflowin review
👉 Pagination workflowin dev
Add the table with a proper UI (TBC)
Remove the export button (TBC)
Post refactoring (defined below) (TBC)

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
N/A image

How to set up and validate locally

Set up steps are similar to other MRs in this issue.

  1. Have an Ultimate License, and simulate Ultimate Self Managed setup (export GITLAB_SIMULATE_SAAS=0)
  2. Enable Setting setting = ApplicationSetting.first; setting.enable_member_promotion_management=true; setting.save!
  3. Enable FF Feature.enable(:member_promotion_management)
  4. Create promotion requests:
    1. Visit any Group as an owner of that group (e.g. http://127.0.0.1:3000/groups/gitlab-org/-/group_members)
    2. try promoting 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
    4. create several requests to test pagination
  5. Open Group or Project members page
  6. You probably won't see pagination yet, as currently the page limit 50 entries, there's a patch below to reduce that limit
patch
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb
index 94f4dfd90b4d..cff0e723af5a 100644
--- a/app/controllers/groups/group_members_controller.rb
+++ b/app/controllers/groups/group_members_controller.rb
@@ -6,7 +6,7 @@ class Groups::GroupMembersController < Groups::ApplicationController
   include SortingHelper
   include Gitlab::Utils::StrongMemoize
 
-  MEMBER_PER_PAGE_LIMIT = 50
+  MEMBER_PER_PAGE_LIMIT = 1
 
   def self.admin_not_required_endpoints
     %i[index leave request_access]
diff --git a/ee/app/controllers/ee/groups/group_members_controller.rb b/ee/app/controllers/ee/groups/group_members_controller.rb
index b6783688e771..9c95057bc0f3 100644
--- a/ee/app/controllers/ee/groups/group_members_controller.rb
+++ b/ee/app/controllers/ee/groups/group_members_controller.rb
@@ -6,7 +6,7 @@ module GroupMembersController
       extend ActiveSupport::Concern
       extend ::Gitlab::Utils::Override
 
-      MEMBER_PER_PAGE_LIMIT = 50
+      MEMBER_PER_PAGE_LIMIT = 1
 
       class_methods do
         extend ::Gitlab::Utils::Override
  1. With lowered limit — you should see pagination, and it should work as regular pagination.
Edited by Kos Palchyk

Merge request reports