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
778a3882
Commit
778a3882
authored
Feb 08, 2022
by
Vasilii Iakliushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix default sort for tags page
Changelog: fixed
parent
e1a881c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+3
-5
spec/controllers/projects/tags_controller_spec.rb
spec/controllers/projects/tags_controller_spec.rb
+8
-0
No files found.
app/controllers/projects/tags_controller.rb
View file @
778a3882
...
...
@@ -16,7 +16,9 @@ class Projects::TagsController < Projects::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def
index
begin
tags_params
[
:sort
]
=
tags_params
[
:sort
].
presence
||
sort_value_recently_updated
tags_params
=
params
.
permit
(
:search
,
:sort
,
:per_page
,
:page_token
,
:page
)
.
with_defaults
(
sort:
sort_value_recently_updated
)
@sort
=
tags_params
[
:sort
]
@search
=
tags_params
[
:search
]
...
...
@@ -101,10 +103,6 @@ class Projects::TagsController < Projects::ApplicationController
private
def
tags_params
params
.
permit
(
:search
,
:sort
,
:per_page
,
:page_token
,
:page
)
end
# TODO: remove this with the release creation moved to it's own form https://gitlab.com/gitlab-org/gitlab/-/issues/214245
def
find_evidence_pipeline
evidence_pipeline_sha
=
@project
.
repository
.
commit
(
params
[
:ref
])
&
.
sha
...
...
spec/controllers/projects/tags_controller_spec.rb
View file @
778a3882
...
...
@@ -17,6 +17,14 @@ RSpec.describe Projects::TagsController do
expect
(
assigns
(
:tags
).
map
(
&
:name
)).
to
include
(
'v1.1.0'
,
'v1.0.0'
)
end
context
'default sort for tags'
do
it
'sorts tags by recently updated'
do
subject
expect
(
assigns
(
:sort
)).
to
eq
(
'updated_desc'
)
end
end
context
'when Gitaly is unavailable'
do
where
(
:format
)
do
[
:html
,
:atom
]
...
...
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