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
e13753fc
Commit
e13753fc
authored
Sep 21, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only take unarchived projects into account
When finding children for a group
parent
29df1ce8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
app/finders/group_descendants_finder.rb
app/finders/group_descendants_finder.rb
+2
-2
spec/finders/group_descendants_finder_spec.rb
spec/finders/group_descendants_finder_spec.rb
+6
-0
No files found.
app/finders/group_descendants_finder.rb
View file @
e13753fc
...
@@ -6,7 +6,7 @@ class GroupDescendantsFinder
...
@@ -6,7 +6,7 @@ class GroupDescendantsFinder
def
initialize
(
current_user:
nil
,
parent_group
:,
params:
{})
def
initialize
(
current_user:
nil
,
parent_group
:,
params:
{})
@current_user
=
current_user
@current_user
=
current_user
@parent_group
=
parent_group
@parent_group
=
parent_group
@params
=
params
@params
=
params
.
reverse_merge
(
non_archived:
true
)
end
end
def
execute
def
execute
...
@@ -74,7 +74,7 @@ class GroupDescendantsFinder
...
@@ -74,7 +74,7 @@ class GroupDescendantsFinder
end
end
def
projects_matching_filter
def
projects_matching_filter
ProjectsFinder
.
new
(
current_user:
current_user
).
execute
ProjectsFinder
.
new
(
current_user:
current_user
,
params:
params
).
execute
.
search
(
params
[
:filter
])
.
search
(
params
[
:filter
])
.
where
(
namespace:
all_descendant_groups
)
.
where
(
namespace:
all_descendant_groups
)
end
end
...
...
spec/finders/group_descendants_finder_spec.rb
View file @
e13753fc
...
@@ -19,6 +19,12 @@ describe GroupDescendantsFinder do
...
@@ -19,6 +19,12 @@ describe GroupDescendantsFinder do
expect
(
finder
.
execute
).
to
contain_exactly
(
project
)
expect
(
finder
.
execute
).
to
contain_exactly
(
project
)
end
end
it
'does not include archived projects'
do
_archived_project
=
create
(
:project
,
:archived
,
namespace:
group
)
expect
(
finder
.
execute
).
to
be_empty
end
context
'with a filter'
do
context
'with a filter'
do
let
(
:params
)
{
{
filter:
'test'
}
}
let
(
:params
)
{
{
filter:
'test'
}
}
...
...
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