Commit 21259857 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '332057-reconcile-partials-for-invite-trigger-and-modal' into 'master'

Reconcile partials for invite trigger and modal

See merge request gitlab-org/gitlab!64218
parents d5e97c8b 1e0c1a6f
......@@ -13,8 +13,16 @@ class Groups::ApplicationController < ApplicationController
before_action :set_sorting
requires_cross_project_access
helper_method :can_manage_members?
private
def can_manage_members?(group = @group)
strong_memoize(:can_manage_members) do
can?(current_user, :admin_group_member, group)
end
end
def group
@group ||= find_routable!(Group, params[:group_id] || params[:id])
end
......
......@@ -22,8 +22,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
feature_category :authentication_and_authorization
helper_method :can_manage_members?
def index
@sort = params[:sort].presence || sort_value_name
......@@ -53,12 +51,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
private
def can_manage_members?
strong_memoize(:can_manage_members) do
can?(current_user, :admin_group_member, @group)
end
end
def present_invited_members(invited_members)
present_members(invited_members
.page(params[:invited_members_page])
......
- if can?(current_user, :admin_group_member, group)
.js-invite-members-modal{ data: { id: group.id,
name: group.name,
is_project: 'false',
access_levels: GroupMember.access_level_roles.to_json,
default_access_level: Gitlab::Access::GUEST,
help_link: help_page_url('user/permissions') }.merge(group_select_data(group)) }
- return unless can_manage_members?(group)
.js-invite-members-modal{ data: { id: group.id,
name: group.name,
is_project: 'false',
access_levels: GroupMember.access_level_roles.to_json,
default_access_level: Gitlab::Access::GUEST,
help_link: help_page_url('user/permissions') }.merge(group_select_data(group)) }
......@@ -9,4 +9,4 @@
event: 'click_button',
label: 'invite_members_empty_project' } }
= render 'shared/issuable/invite_members_trigger', project: @project
= render 'projects/invite_members_modal', project: @project
- if can_invite_members_for_project?(project)
.js-invite-members-modal{ data: { id: project.id,
name: project.name,
is_project: 'true',
access_levels: ProjectMember.access_level_roles.to_json,
default_access_level: Gitlab::Access::GUEST,
help_link: help_page_url('user/permissions') } }
- return unless can_import_members?
.js-invite-members-modal{ data: { id: project.id,
name: project.name,
is_project: 'true',
access_levels: ProjectMember.access_level_roles.to_json,
default_access_level: Gitlab::Access::GUEST,
help_link: help_page_url('user/permissions') } }
......@@ -4,4 +4,4 @@
- page_title "#{@issue.title} (#{@issue.to_reference})", _("Issues")
= render 'projects/issuable/show', issuable: @issue, api_awards_path: award_emoji_issue_api_path(@issue)
= render 'shared/issuable/invite_members_trigger', project: @project
= render 'projects/invite_members_modal', project: @project
......@@ -96,5 +96,5 @@
#js-review-bar
= render 'shared/issuable/invite_members_trigger', project: @project
= render 'projects/invite_members_modal', project: @project
- return unless can_import_members?
.js-invite-members-modal{ data: { id: project.id,
name: project.name,
is_project: 'true',
access_levels: ProjectMember.access_level_roles.to_json,
default_access_level: Gitlab::Access::GUEST,
help_link: help_page_url('user/permissions') } }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment