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
329566d0
Commit
329566d0
authored
Dec 10, 2020
by
Lee Tickett
Committed by
Mayra Cabrera
Dec 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Default Project Listing Sort Order (to Name)
parent
628f756f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
16 deletions
+21
-16
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+1
-1
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+1
-1
app/finders/group_descendants_finder.rb
app/finders/group_descendants_finder.rb
+1
-1
changelogs/unreleased/change_default_project_sort.yml
changelogs/unreleased/change_default_project_sort.yml
+5
-0
spec/features/dashboard/archived_projects_spec.rb
spec/features/dashboard/archived_projects_spec.rb
+1
-1
spec/features/dashboard/user_filters_projects_spec.rb
spec/features/dashboard/user_filters_projects_spec.rb
+2
-2
spec/finders/group_descendants_finder_spec.rb
spec/finders/group_descendants_finder_spec.rb
+3
-3
spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb
...contexts/finders/group_projects_finder_shared_contexts.rb
+7
-7
No files found.
app/controllers/dashboard/projects_controller.rb
View file @
329566d0
...
...
@@ -108,7 +108,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
def
default_sort_order
sort_value_
latest_activity
sort_value_
name
end
def
sorting_field
...
...
app/controllers/explore/projects_controller.rb
View file @
329566d0
...
...
@@ -94,7 +94,7 @@ class Explore::ProjectsController < Explore::ApplicationController
end
def
default_sort_order
sort_value_
latest_activity
sort_value_
name
end
def
sorting_field
...
...
app/finders/group_descendants_finder.rb
View file @
329566d0
...
...
@@ -176,7 +176,7 @@ class GroupDescendantsFinder
end
def
sort
params
.
fetch
(
:sort
,
'
created_de
sc'
)
params
.
fetch
(
:sort
,
'
name_a
sc'
)
end
# rubocop: disable CodeReuse/ActiveRecord
...
...
changelogs/unreleased/change_default_project_sort.yml
0 → 100644
View file @
329566d0
---
title
:
Change default project listing sort order to name
merge_request
:
47734
author
:
Lee Tickett
type
:
changed
spec/features/dashboard/archived_projects_spec.rb
View file @
329566d0
...
...
@@ -36,7 +36,7 @@ RSpec.describe 'Dashboard Archived Project' do
end
it
'searches archived projects'
,
:js
do
click_button
'
Last updated
'
click_button
'
Name
'
click_link
'Show archived projects'
expect
(
page
).
to
have_link
(
project
.
name
)
...
...
spec/features/dashboard/user_filters_projects_spec.rb
View file @
329566d0
...
...
@@ -173,11 +173,11 @@ RSpec.describe 'Dashboard > User filters projects' do
end
end
it
'defaults to "
Last updated
"'
,
:js
do
it
'defaults to "
Name
"'
,
:js
do
page
.
find
(
'.filtered-search-block #filtered-search-sorting-dropdown'
).
click
active_sorting_option
=
page
.
first
(
'.filtered-search-block #filtered-search-sorting-dropdown .is-active'
)
expect
(
active_sorting_option
).
to
have_content
'
Last updated
'
expect
(
active_sorting_option
).
to
have_content
'
Name
'
end
context
'Sorting by name'
do
...
...
spec/finders/group_descendants_finder_spec.rb
View file @
329566d0
...
...
@@ -77,9 +77,9 @@ RSpec.describe GroupDescendantsFinder do
end
end
it
'sorts elements by
latest created
as default'
do
project1
=
create
(
:project
,
namespace:
group
,
created_at:
1
.
hour
.
ago
)
project2
=
create
(
:project
,
namespace:
group
)
it
'sorts elements by
name
as default'
do
project1
=
create
(
:project
,
namespace:
group
,
name:
'z'
)
project2
=
create
(
:project
,
namespace:
group
,
name:
'a'
)
expect
(
subject
.
execute
).
to
eq
([
project2
,
project1
])
end
...
...
spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb
View file @
329566d0
...
...
@@ -9,13 +9,13 @@ RSpec.shared_context 'GroupProjectsFinder context' do
let
(
:finder
)
{
described_class
.
new
(
group:
group
,
current_user:
current_user
,
params:
params
,
options:
options
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
,
group:
group
,
path:
'1'
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
,
group:
group
,
path:
'2'
)
}
let_it_be
(
:shared_project_1
)
{
create
(
:project
,
:public
,
path:
'3'
)
}
let_it_be
(
:shared_project_2
)
{
create
(
:project
,
:private
,
path:
'4'
)
}
let_it_be
(
:shared_project_3
)
{
create
(
:project
,
:internal
,
path:
'5'
)
}
let_it_be
(
:subgroup_project
)
{
create
(
:project
,
:public
,
path:
'6'
,
group:
subgroup
)
}
let_it_be
(
:subgroup_private_project
)
{
create
(
:project
,
:private
,
path:
'7'
,
group:
subgroup
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
,
group:
group
,
path:
'1'
,
name:
'g'
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
,
group:
group
,
path:
'2'
,
name:
'f'
)
}
let_it_be
(
:shared_project_1
)
{
create
(
:project
,
:public
,
path:
'3'
,
name:
'e'
)
}
let_it_be
(
:shared_project_2
)
{
create
(
:project
,
:private
,
path:
'4'
,
name:
'd'
)
}
let_it_be
(
:shared_project_3
)
{
create
(
:project
,
:internal
,
path:
'5'
,
name:
'c'
)
}
let_it_be
(
:subgroup_project
)
{
create
(
:project
,
:public
,
path:
'6'
,
group:
subgroup
,
name:
'b'
)
}
let_it_be
(
:subgroup_private_project
)
{
create
(
:project
,
:private
,
path:
'7'
,
group:
subgroup
,
name:
'a'
)
}
before
do
shared_project_1
.
project_group_links
.
create!
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
...
...
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