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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
7611e6a0
Commit
7611e6a0
authored
Oct 10, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some cleanup in the GroupDescendantFinder
parent
aee5691d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
app/finders/group_descendants_finder.rb
app/finders/group_descendants_finder.rb
+5
-8
No files found.
app/finders/group_descendants_finder.rb
View file @
7611e6a0
...
@@ -9,7 +9,7 @@ class GroupDescendantsFinder
...
@@ -9,7 +9,7 @@ class GroupDescendantsFinder
def
execute
def
execute
# The children array might be extended with the ancestors of projects when
# The children array might be extended with the ancestors of projects when
# filtering. In that case, take the maximum so the aray does not get limited
# filtering. In that case, take the maximum so the ar
r
ay does not get limited
# Otherwise, allow paginating through all results
# Otherwise, allow paginating through all results
#
#
all_required_elements
=
children
all_required_elements
=
children
...
@@ -29,12 +29,9 @@ class GroupDescendantsFinder
...
@@ -29,12 +29,9 @@ class GroupDescendantsFinder
@children
||=
paginator
.
paginate
(
params
[
:page
])
@children
||=
paginator
.
paginate
(
params
[
:page
])
end
end
def
collections
[
subgroups
.
with_selects_for_list
,
projects
]
end
def
paginator
def
paginator
@paginator
||=
Gitlab
::
MultiCollectionPaginator
.
new
(
*
collections
,
per_page:
params
[
:per_page
])
@paginator
||=
Gitlab
::
MultiCollectionPaginator
.
new
(
subgroups
,
projects
,
per_page:
params
[
:per_page
])
end
end
def
direct_child_groups
def
direct_child_groups
...
@@ -99,7 +96,7 @@ class GroupDescendantsFinder
...
@@ -99,7 +96,7 @@ class GroupDescendantsFinder
else
else
direct_child_groups
direct_child_groups
end
end
groups
.
order_by
(
sort
)
groups
.
with_selects_for_list
.
order_by
(
sort
)
end
end
def
projects_for_user
def
projects_for_user
...
@@ -110,7 +107,7 @@ class GroupDescendantsFinder
...
@@ -110,7 +107,7 @@ class GroupDescendantsFinder
projects_for_user
.
where
(
namespace:
parent_group
)
projects_for_user
.
where
(
namespace:
parent_group
)
end
end
# Finds all projects nested under `parent_group` or any of it
'
s descendant
# Finds all projects nested under `parent_group` or any of its descendant
# groups
# groups
def
projects_matching_filter
def
projects_matching_filter
projects_for_user
.
search
(
params
[
:filter
])
projects_for_user
.
search
(
params
[
:filter
])
...
...
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