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
2c3c5b35
Commit
2c3c5b35
authored
Jan 20, 2018
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't include projects shared as group-descendants
When a project is shared with a group, it should not be included as a descendant on the group dashboard.
parent
c56326fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
group_descendants_finder.rb
app/finders/group_descendants_finder.rb
+4
-2
group_descendants_finder_spec.rb
spec/finders/group_descendants_finder_spec.rb
+10
-1
No files found.
app/finders/group_descendants_finder.rb
View file @
2c3c5b35
...
...
@@ -121,8 +121,10 @@ class GroupDescendantsFinder
end
def
direct_child_projects
GroupProjectsFinder
.
new
(
group:
parent_group
,
current_user:
current_user
,
params:
params
)
.
execute
GroupProjectsFinder
.
new
(
group:
parent_group
,
current_user:
current_user
,
options:
{
only_owned:
true
},
params:
params
).
execute
end
# Finds all projects nested under `parent_group` or any of its descendant
...
...
spec/finders/group_descendants_finder_spec.rb
View file @
2c3c5b35
...
...
@@ -35,6 +35,15 @@ describe GroupDescendantsFinder do
expect
(
finder
.
execute
).
to
contain_exactly
(
project
)
end
it
'does not include projects shared with the group'
do
project
=
create
(
:project
,
namespace:
group
)
other_project
=
create
(
:project
)
other_project
.
project_group_links
.
create
(
group:
group
,
group_access:
ProjectGroupLink
::
MASTER
)
expect
(
finder
.
execute
).
to
contain_exactly
(
project
)
end
context
'when archived is `true`'
do
let
(
:params
)
{
{
archived:
'true'
}
}
...
...
@@ -64,7 +73,7 @@ describe GroupDescendantsFinder do
end
context
'with a filter'
do
let
(
:params
)
{
{
filter:
'tes
t
'
}
}
let
(
:params
)
{
{
filter:
'tes'
}
}
it
'includes only projects matching the filter'
do
_other_project
=
create
(
:project
,
namespace:
group
)
...
...
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