BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0ebf1462
Commit
0ebf1462
authored
Mar 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dz-hide-share-group-ancestors' into 'master'
Hide ancestor groups in the share group dropdown list Closes #29311 See merge request !9965
parents
8548aaa0
e8942846
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
2 deletions
+29
-2
members_controller.rb
app/controllers/projects/settings/members_controller.rb
+1
-0
group.rb
app/models/group.rb
+1
-1
dz-hide-share-group-ancestors.yml
changelogs/unreleased/dz-hide-share-group-ancestors.yml
+4
-0
group_links_spec.rb
spec/features/projects/group_links_spec.rb
+23
-1
No files found.
app/controllers/projects/settings/members_controller.rb
View file @
0ebf1462
...
...
@@ -9,6 +9,7 @@ module Projects
@skip_groups
=
@group_links
.
pluck
(
:group_id
)
@skip_groups
<<
@project
.
namespace_id
unless
@project
.
personal?
@skip_groups
+=
@project
.
group
.
ancestors
.
pluck
(
:id
)
if
@project
.
group
@project_members
=
MembersFinder
.
new
(
@project
,
current_user
).
execute
...
...
app/models/group.rb
View file @
0ebf1462
...
...
@@ -207,7 +207,7 @@ class Group < Namespace
end
def
members_with_parents
GroupMember
.
non_request
.
where
(
source_id:
ancestors
.
map
(
&
:id
).
push
(
id
))
GroupMember
.
non_request
.
where
(
source_id:
ancestors
.
pluck
(
:id
).
push
(
id
))
end
def
users_with_parents
...
...
changelogs/unreleased/dz-hide-share-group-ancestors.yml
0 → 100644
View file @
0ebf1462
---
title
:
Hide ancestor groups in the share group dropdown list
merge_request
:
9965
author
:
spec/features/projects/group_links_spec.rb
View file @
0ebf1462
...
...
@@ -8,7 +8,7 @@ feature 'Project group links', feature: true, js: true do
let!
(
:group
)
{
create
(
:group
)
}
background
do
project
.
team
<<
[
master
,
:master
]
project
.
add_master
(
master
)
login_as
(
master
)
end
...
...
@@ -29,4 +29,26 @@ feature 'Project group links', feature: true, js: true do
end
end
end
context
'nested group project'
do
let!
(
:nested_group
)
{
create
(
:group
,
parent:
group
)
}
let!
(
:another_group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
nested_group
)
}
background
do
group
.
add_master
(
master
)
another_group
.
add_master
(
master
)
end
it
'does not show ancestors'
do
visit
namespace_project_settings_members_path
(
project
.
namespace
,
project
)
click_link
'Search for a group'
page
.
within
'.select2-drop'
do
expect
(
page
).
to
have_content
(
another_group
.
name
)
expect
(
page
).
not_to
have_content
(
group
.
name
)
end
end
end
end
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