Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1e0c1a6f
Commit
1e0c1a6f
authored
Jun 16, 2021
by
Doug Stull
Committed by
Olena Horal-Koretska
Jun 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve some duplicate partials and logic on invite modal
- clear things up a bit.
parent
96bd5098
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
33 deletions
+27
-33
app/controllers/groups/application_controller.rb
app/controllers/groups/application_controller.rb
+8
-0
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+0
-8
app/views/groups/_invite_members_modal.html.haml
app/views/groups/_invite_members_modal.html.haml
+8
-7
app/views/projects/_invite_members.html.haml
app/views/projects/_invite_members.html.haml
+1
-1
app/views/projects/_invite_members_modal.html.haml
app/views/projects/_invite_members_modal.html.haml
+8
-7
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+1
-1
app/views/projects/merge_requests/show.html.haml
app/views/projects/merge_requests/show.html.haml
+1
-1
app/views/shared/issuable/_invite_members_trigger.html.haml
app/views/shared/issuable/_invite_members_trigger.html.haml
+0
-8
No files found.
app/controllers/groups/application_controller.rb
View file @
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
...
...
app/controllers/groups/group_members_controller.rb
View file @
1e0c1a6f
...
...
@@ -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
])
...
...
app/views/groups/_invite_members_modal.html.haml
View file @
1e0c1a6f
-
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
))
}
app/views/projects/_invite_members.html.haml
View file @
1e0c1a6f
...
...
@@ -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
app/views/projects/_invite_members_modal.html.haml
View file @
1e0c1a6f
-
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'
)
}
}
app/views/projects/issues/show.html.haml
View file @
1e0c1a6f
...
...
@@ -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
app/views/projects/merge_requests/show.html.haml
View file @
1e0c1a6f
...
...
@@ -96,5 +96,5 @@
#js-review-bar
=
render
'
shared/issuable/invite_members_trigger
'
,
project:
@project
=
render
'
projects/invite_members_modal
'
,
project:
@project
app/views/shared/issuable/_invite_members_trigger.html.haml
deleted
100644 → 0
View file @
96bd5098
-
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'
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment