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
643100a9
Commit
643100a9
authored
Jul 04, 2019
by
David Palubin
Committed by
Lin Jen-Shin
Jul 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set default project sort method prior to initial sort on page loading
parent
c47eef94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+1
-1
changelogs/unreleased/issue-63222.yml
changelogs/unreleased/issue-63222.yml
+5
-0
spec/controllers/dashboard/projects_controller_spec.rb
spec/controllers/dashboard/projects_controller_spec.rb
+17
-1
No files found.
app/controllers/dashboard/projects_controller.rb
View file @
643100a9
...
...
@@ -7,8 +7,8 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
before_action
:set_non_archived_param
before_action
:projects
,
only:
[
:index
]
before_action
:default_sorting
before_action
:projects
,
only:
[
:index
]
skip_cross_project_access_check
:index
,
:starred
def
index
...
...
changelogs/unreleased/issue-63222.yml
0 → 100644
View file @
643100a9
---
title
:
Set default sort method for dashboard projects list
merge_request
:
29830
author
:
David Palubin
type
:
fixed
spec/controllers/dashboard/projects_controller_spec.rb
View file @
643100a9
...
...
@@ -11,8 +11,10 @@ describe Dashboard::ProjectsController do
end
context
'user logged in'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
create
(
:
user
)
sign_in
(
user
)
end
context
'external authorization'
do
...
...
@@ -24,6 +26,20 @@ describe Dashboard::ProjectsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it
'orders the projects by last activity by default'
do
project
=
create
(
:project
)
project
.
add_developer
(
user
)
project
.
update!
(
last_repository_updated_at:
3
.
days
.
ago
,
last_activity_at:
3
.
days
.
ago
)
project2
=
create
(
:project
)
project2
.
add_developer
(
user
)
project2
.
update!
(
last_repository_updated_at:
10
.
days
.
ago
,
last_activity_at:
10
.
days
.
ago
)
get
:index
expect
(
assigns
(
:projects
)).
to
eq
([
project
,
project2
])
end
end
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