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
18907efb
Commit
18907efb
authored
Oct 11, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass `archived:` as a keyword argument
parent
8cde1e32
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
app/controllers/concerns/group_tree.rb
app/controllers/concerns/group_tree.rb
+1
-1
app/finders/group_descendants_finder.rb
app/finders/group_descendants_finder.rb
+2
-2
app/models/concerns/loaded_in_group_list.rb
app/models/concerns/loaded_in_group_list.rb
+3
-3
spec/models/concerns/loaded_in_group_list_spec.rb
spec/models/concerns/loaded_in_group_list_spec.rb
+2
-2
No files found.
app/controllers/concerns/group_tree.rb
View file @
18907efb
...
...
@@ -7,7 +7,7 @@ module GroupTree
# Only show root groups if no parent-id is given
groups
.
where
(
parent_id:
params
[
:parent_id
])
end
@groups
=
@groups
.
with_selects_for_list
(
params
[
:archived
])
@groups
=
@groups
.
with_selects_for_list
(
archived:
params
[
:archived
])
.
sort
(
@sort
=
params
[
:sort
])
.
page
(
params
[
:page
])
...
...
app/finders/group_descendants_finder.rb
View file @
18907efb
...
...
@@ -102,7 +102,7 @@ class GroupDescendantsFinder
projects_to_load_ancestors_of
=
projects
.
where
.
not
(
namespace:
parent_group
)
groups_to_load_ancestors_of
=
Group
.
where
(
id:
projects_to_load_ancestors_of
.
select
(
:namespace_id
))
ancestors_for_groups
(
groups_to_load_ancestors_of
)
.
with_selects_for_list
(
params
[
:archived
])
.
with_selects_for_list
(
archived:
params
[
:archived
])
end
def
subgroups
...
...
@@ -115,7 +115,7 @@ class GroupDescendantsFinder
else
direct_child_groups
end
groups
.
with_selects_for_list
(
params
[
:archived
]).
order_by
(
sort
)
groups
.
with_selects_for_list
(
archived:
params
[
:archived
]).
order_by
(
sort
)
end
def
direct_child_projects
...
...
app/models/concerns/loaded_in_group_list.rb
View file @
18907efb
...
...
@@ -24,13 +24,13 @@ module LoadedInGroupList
MEMBER_COUNT_SQL
].
freeze
module
ClassMethods
def
with_counts
(
archived
=
nil
)
def
with_counts
(
archived
:
)
selects
=
COUNT_SELECTS
.
dup
<<
project_count
(
archived
)
select
(
selects
)
end
def
with_selects_for_list
(
archived
=
nil
)
with_route
.
with_counts
(
archived
)
def
with_selects_for_list
(
archived
:
nil
)
with_route
.
with_counts
(
archived
:
archived
)
end
def
project_count
(
archived
)
...
...
spec/models/concerns/loaded_in_group_list_spec.rb
View file @
18907efb
...
...
@@ -22,7 +22,7 @@ describe LoadedInGroupList do
create
(
:project
,
namespace:
parent
,
archived:
true
)
create
(
:project
,
namespace:
parent
)
found_group
=
Group
.
with_selects_for_list
(
'true'
).
find_by
(
id:
parent
.
id
)
found_group
=
Group
.
with_selects_for_list
(
archived:
'true'
).
find_by
(
id:
parent
.
id
)
expect
(
found_group
.
preloaded_project_count
).
to
eq
(
2
)
end
...
...
@@ -31,7 +31,7 @@ describe LoadedInGroupList do
create_list
(
:project
,
2
,
namespace:
parent
,
archived:
true
)
create
(
:project
,
namespace:
parent
)
found_group
=
Group
.
with_selects_for_list
(
'only'
).
find_by
(
id:
parent
.
id
)
found_group
=
Group
.
with_selects_for_list
(
archived:
'only'
).
find_by
(
id:
parent
.
id
)
expect
(
found_group
.
preloaded_project_count
).
to
eq
(
2
)
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