Added pending member approval list
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:
-
Helper Methods Update: Both
group_members_app_data
andproject_members_app_data
helper methods have been updated to includepending_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. -
Member Approval Model Enhancements: The
MemberApproval
model has been updated with thePresentable
module inclusion, allowing it to be presented using custom presenters. Additionally, a new scopepending_member_approvals
has been added to fetch member approvals that are pending based on themember_namespace_id
. -
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. -
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. - 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.
- 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.
-
New Serializers: New serializers have been added for member approvals, including
MemberApprovalEntity
andMemberApprovalSerializer
, to handle the serialization of member approval data for API responses. - 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
- Enable Setting
setting = ApplicationSetting.first; setting.enable_member_promotion_management=true; setting.save!
- Enable FF
Feature.enable(:member_promotion_management)
- Purchase Ultimate License, and simulate Ultimate SM setup
- Visit any Group as a non-instance-admin user (i.e. an owner)
- try promoting a non-billable GUEST member to a DEVELOPER role
- Reload the page, and the page should reload fine.
- 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".