Skip to content

Added pending member approval list

Suraj Tripathi requested to merge 433173_be_list_pending_members into master

What does this MR do and why?

This MR adds pending_members to group and project member list pages, which will be used by Frontend to display member approvals pending promotion. Here's a summary of the changes:

  1. Helper Methods Update: Both group_members_app_data and project_members_app_data helper methods have been updated to include pending_members as a parameter. This change allows the application to handle pending member approvals more effectively, ensuring that the data related to members awaiting approval is passed correctly to the frontend.
  2. Member Approval Model Enhancements: The MemberApproval model has been updated with the Presentable module inclusion, allowing it to be presented using custom presenters. Additionally, a new scope pending_member_approvals has been added to fetch member approvals that are pending based on the member_namespace_id.
  3. New Presenter: A new presenter, MemberApprovalPresenter, has been added to handle the presentation logic for member approvals. This presenter includes methods to present the new and old access levels in a human-readable format, along with methods to present the source ID, name, and web URL.
  4. Views Update: The views for group and project members index have been updated to pass pending_members data to the frontend, allowing the display of pending member approvals in the UI.
  5. Controllers Enhancement: Both group and project members controllers have been updated to handle the fetching and pagination of pending member approvals. This includes checking feature flags and application settings to ensure that the member promotion management feature is enabled before fetching pending approvals.
  6. Helpers Enhancement: New helper methods have been added to both group and project members helpers to handle the serialization and pagination of pending member approvals, ensuring that the data is correctly prepared for display in the frontend.
  7. New Serializers: New serializers have been added for member approvals, including MemberApprovalEntity and MemberApprovalSerializer, to handle the serialization of member approval data for API responses.
  8. Specs Update: Tests have been added across helpers, presenters, controllers, and serializers to ensure the correctness of the new features and enhancements.

ref: #433173 (closed)

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Enable Setting setting = ApplicationSetting.first; setting.enable_member_promotion_management=true; setting.save!
  2. Enable FF Feature.enable(:member_promotion_management)
  3. Purchase Ultimate License, and simulate Ultimate SM setup
  4. Visit any Group as a non-instance-admin user (i.e. an owner)
  5. try promoting a non-billable GUEST member to a DEVELOPER role
  6. Reload the page, and the page should reload fine.
  7. Repeat the same for a Project member

NOTE: The user should be non-billable on the instance, i.e. have a GUEST highest role. If there's any hiccup in role updates or billable position calculation — please check the instance Background Jobs, and in the scheduled tab select all UpdateHighestRoleWorker jobs, and press "Add to the queue".

example

image

Edited by Kos Palchyk

Merge request reports