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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
9ee274c0
Commit
9ee274c0
authored
May 03, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tags sort dropdown being empty
Closes #31618
parent
554c4e0d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
9 deletions
+34
-9
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+8
-0
app/views/projects/tags/index.html.haml
app/views/projects/tags/index.html.haml
+7
-9
changelogs/unreleased/tags-sort-default.yml
changelogs/unreleased/tags-sort-default.yml
+4
-0
spec/features/projects/tags/sort_spec.rb
spec/features/projects/tags/sort_spec.rb
+15
-0
No files found.
app/helpers/sorting_helper.rb
View file @
9ee274c0
...
@@ -70,6 +70,14 @@ module SortingHelper
...
@@ -70,6 +70,14 @@ module SortingHelper
}
}
end
end
def
tags_sort_options_hash
{
sort_value_name
=>
sort_title_name
,
sort_value_recently_updated
=>
sort_title_recently_updated
,
sort_value_oldest_updated
=>
sort_title_oldest_updated
}
end
def
sort_title_priority
def
sort_title_priority
'Priority'
'Priority'
end
end
...
...
app/views/projects/tags/index.html.haml
View file @
9ee274c0
...
@@ -14,16 +14,14 @@
...
@@ -14,16 +14,14 @@
.dropdown
.dropdown
%button
.dropdown-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
%button
.dropdown-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
%span
.light
%span
.light
=
project
s_sort_options_hash
[
@sort
]
=
tag
s_sort_options_hash
[
@sort
]
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
%ul
.dropdown-menu.dropdown-menu-align-right
%ul
.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
%li
%li
.dropdown-header
=
link_to
filter_tags_path
(
sort:
sort_value_name
)
do
Sort by
=
sort_title_name
-
tags_sort_options_hash
.
each
do
|
value
,
title
|
=
link_to
filter_tags_path
(
sort:
sort_value_recently_updated
)
do
%li
=
sort_title_recently_updated
=
link_to
title
,
filter_tags_path
(
sort:
value
),
class:
(
"is-active"
if
@sort
==
value
)
=
link_to
filter_tags_path
(
sort:
sort_value_oldest_updated
)
do
=
sort_title_oldest_updated
-
if
can?
(
current_user
,
:push_code
,
@project
)
-
if
can?
(
current_user
,
:push_code
,
@project
)
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create new-tag-btn'
do
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create new-tag-btn'
do
New tag
New tag
...
...
changelogs/unreleased/tags-sort-default.yml
0 → 100644
View file @
9ee274c0
---
title
:
Fixed tags sort from defaulting to empty
merge_request
:
author
:
spec/features/projects/tags/sort_spec.rb
0 → 100644
View file @
9ee274c0
require
'spec_helper'
feature
'Tags sort dropdown'
,
:feature
do
let
(
:project
)
{
create
(
:project
)
}
before
do
login_as
(
:admin
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
it
'defaults sort dropdown to last updated'
do
expect
(
page
).
to
have_button
(
'Last updated'
)
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