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
1fb49b87
Commit
1fb49b87
authored
7 years ago
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show root groups on the dashboard
The children are lazy-loaded when expanding
parent
3299a970
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
14 deletions
+3
-14
app/controllers/dashboard/groups_controller.rb
app/controllers/dashboard/groups_controller.rb
+3
-13
app/finders/group_children_finder.rb
app/finders/group_children_finder.rb
+0
-1
No files found.
app/controllers/dashboard/groups_controller.rb
View file @
1fb49b87
...
@@ -2,19 +2,9 @@ class Dashboard::GroupsController < Dashboard::ApplicationController
...
@@ -2,19 +2,9 @@ class Dashboard::GroupsController < Dashboard::ApplicationController
def
index
def
index
@sort
=
params
[
:sort
]
||
'id_desc'
@sort
=
params
[
:sort
]
||
'id_desc'
@groups
=
@groups
=
GroupsFinder
.
new
(
current_user
,
all_available:
false
).
execute
if
params
[
:parent_id
]
&&
Group
.
supports_nested_groups?
# Only show root groups if no parent-id is given
parent
=
Group
.
find_by
(
id:
params
[
:parent_id
])
@groups
=
@groups
.
where
(
parent_id:
params
[
:parent_id
])
if
can?
(
current_user
,
:read_group
,
parent
)
GroupsFinder
.
new
(
current_user
,
parent:
parent
).
execute
else
Group
.
none
end
else
current_user
.
groups
end
@groups
=
@groups
.
search
(
params
[
:filter
])
if
params
[
:filter
].
present?
@groups
=
@groups
.
search
(
params
[
:filter
])
if
params
[
:filter
].
present?
@groups
=
@groups
.
includes
(
:route
)
@groups
=
@groups
.
includes
(
:route
)
@groups
=
@groups
.
sort
(
@sort
)
@groups
=
@groups
.
sort
(
@sort
)
...
...
This diff is collapsed.
Click to expand it.
app/finders/group_children_finder.rb
View file @
1fb49b87
...
@@ -64,7 +64,6 @@ class GroupChildrenFinder
...
@@ -64,7 +64,6 @@ class GroupChildrenFinder
else
else
base_groups
base_groups
end
end
groups
=
groups
groups
.
sort
(
params
[
:sort
]).
includes
(
:route
)
groups
.
sort
(
params
[
:sort
]).
includes
(
:route
)
end
end
...
...
This diff is collapsed.
Click to expand it.
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