diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/helpers/projects/project_members_helper.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/helpers/projects/project_members_helper.rb')
-rw-r--r-- | app/helpers/projects/project_members_helper.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/app/helpers/projects/project_members_helper.rb b/app/helpers/projects/project_members_helper.rb index fa68bbad135..0871d5638b8 100644 --- a/app/helpers/projects/project_members_helper.rb +++ b/app/helpers/projects/project_members_helper.rb @@ -27,12 +27,15 @@ module Projects::ProjectMembersHelper project.group.has_owner?(current_user) end - def project_members_list_data_json(project, members, pagination = {}) - project_members_list_data(project, members, pagination).to_json - end - - def project_group_links_list_data_json(project, group_links) - project_group_links_list_data(project, group_links).to_json + def project_members_app_data_json(project, members:, group_links:, invited:, access_requests:) + { + user: project_members_list_data(project, members, { param_name: :page, params: { search_groups: nil } }), + group: project_group_links_list_data(project, group_links), + invite: project_members_list_data(project, invited.nil? ? [] : invited), + access_request: project_members_list_data(project, access_requests.nil? ? [] : access_requests), + source_id: project.id, + can_manage_members: can_manage_project_members?(project) + }.to_json end private @@ -45,13 +48,11 @@ module Projects::ProjectMembersHelper GroupLink::ProjectGroupLinkSerializer.new.represent(group_links, { current_user: current_user }) end - def project_members_list_data(project, members, pagination) + def project_members_list_data(project, members, pagination = {}) { members: project_members_serialized(project, members), pagination: members_pagination_data(members, pagination), - member_path: project_project_member_path(project, ':id'), - source_id: project.id, - can_manage_members: can_manage_project_members?(project) + member_path: project_project_member_path(project, ':id') } end @@ -59,9 +60,7 @@ module Projects::ProjectMembersHelper { members: project_group_links_serialized(group_links), pagination: members_pagination_data(group_links), - member_path: project_group_link_path(project, ':id'), - source_id: project.id, - can_manage_members: can_manage_project_members?(project) + member_path: project_group_link_path(project, ':id') } end end |