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
e7deeddc
Commit
e7deeddc
authored
Dec 20, 2017
by
Mark Fletcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable sorting by name in the Groups dropdown
parent
225980db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+2
-0
changelogs/unreleased/36958-enable-ordering-projects-subgroups-by-name.yml
...ased/36958-enable-ordering-projects-subgroups-by-name.yml
+5
-0
spec/finders/group_descendants_finder_spec.rb
spec/finders/group_descendants_finder_spec.rb
+35
-0
No files found.
app/helpers/sorting_helper.rb
View file @
e7deeddc
...
...
@@ -44,6 +44,8 @@ module SortingHelper
def
groups_sort_options_hash
{
sort_value_name
=>
sort_title_name
,
sort_value_name_desc
=>
sort_title_name_desc
,
sort_value_recently_created
=>
sort_title_recently_created
,
sort_value_oldest_created
=>
sort_title_oldest_created
,
sort_value_recently_updated
=>
sort_title_recently_updated
,
...
...
changelogs/unreleased/36958-enable-ordering-projects-subgroups-by-name.yml
0 → 100644
View file @
e7deeddc
---
title
:
Enable ordering of groups and their children by name
merge_request
:
author
:
type
:
added
spec/finders/group_descendants_finder_spec.rb
View file @
e7deeddc
...
...
@@ -73,6 +73,41 @@ describe GroupDescendantsFinder do
expect
(
finder
.
execute
).
to
contain_exactly
(
matching_project
)
end
end
context
'sorting by name'
do
let!
(
:project1
)
{
create
(
:project
,
namespace:
group
,
name:
'a'
,
path:
'project-a'
)
}
let!
(
:project2
)
{
create
(
:project
,
namespace:
group
,
name:
'z'
,
path:
'project-z'
)
}
let
(
:params
)
do
{
sort:
'name_asc'
}
end
it
'sorts elements by name'
do
expect
(
subject
.
execute
).
to
eq
(
[
project1
,
project2
]
)
end
context
'with nested groups'
,
:nested_groups
do
let!
(
:subgroup1
)
{
create
(
:group
,
parent:
group
,
name:
'a'
,
path:
'sub-a'
)
}
let!
(
:subgroup2
)
{
create
(
:group
,
parent:
group
,
name:
'z'
,
path:
'sub-z'
)
}
it
'sorts elements by name'
do
expect
(
subject
.
execute
).
to
eq
(
[
subgroup1
,
subgroup2
,
project1
,
project2
]
)
end
end
end
end
context
'with nested groups'
,
:nested_groups
do
...
...
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