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
Boxiang Sun
gitlab-ce
Commits
0a89c08c
Commit
0a89c08c
authored
May 04, 2019
by
Nermin Vehabovic
Committed by
Douglas Barbosa Alexandre
May 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Sort by due date and popularity in both directions"
parent
08d1cc5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
16 deletions
+35
-16
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+16
-2
changelogs/unreleased/50926-sort-by-due-date-and-popularity.yml
...logs/unreleased/50926-sort-by-due-date-and-popularity.yml
+5
-0
spec/features/issuables/sorting_list_spec.rb
spec/features/issuables/sorting_list_spec.rb
+14
-14
No files found.
app/helpers/sorting_helper.rb
View file @
0a89c08c
...
@@ -142,7 +142,9 @@ module SortingHelper
...
@@ -142,7 +142,9 @@ module SortingHelper
{
{
sort_value_oldest_created
=>
sort_value_created_date
,
sort_value_oldest_created
=>
sort_value_created_date
,
sort_value_oldest_updated
=>
sort_value_recently_updated
,
sort_value_oldest_updated
=>
sort_value_recently_updated
,
sort_value_milestone_later
=>
sort_value_milestone
sort_value_milestone_later
=>
sort_value_milestone
,
sort_value_due_date_later
=>
sort_value_due_date
,
sort_value_least_popular
=>
sort_value_popularity
}
}
end
end
...
@@ -151,7 +153,11 @@ module SortingHelper
...
@@ -151,7 +153,11 @@ module SortingHelper
sort_value_created_date
=>
sort_value_oldest_created
,
sort_value_created_date
=>
sort_value_oldest_created
,
sort_value_recently_created
=>
sort_value_oldest_created
,
sort_value_recently_created
=>
sort_value_oldest_created
,
sort_value_recently_updated
=>
sort_value_oldest_updated
,
sort_value_recently_updated
=>
sort_value_oldest_updated
,
sort_value_milestone
=>
sort_value_milestone_later
sort_value_milestone
=>
sort_value_milestone_later
,
sort_value_due_date
=>
sort_value_due_date_later
,
sort_value_due_date_soon
=>
sort_value_due_date_later
,
sort_value_popularity
=>
sort_value_least_popular
,
sort_value_most_popular
=>
sort_value_least_popular
}.
merge
(
issuable_sort_option_overrides
)
}.
merge
(
issuable_sort_option_overrides
)
end
end
...
@@ -420,6 +426,14 @@ module SortingHelper
...
@@ -420,6 +426,14 @@ module SortingHelper
'popularity'
'popularity'
end
end
def
sort_value_most_popular
'popularity_desc'
end
def
sort_value_least_popular
'popularity_asc'
end
def
sort_value_priority
def
sort_value_priority
'priority'
'priority'
end
end
...
...
changelogs/unreleased/50926-sort-by-due-date-and-popularity.yml
0 → 100644
View file @
0a89c08c
---
title
:
Sort by due date and popularity in both directions for Issues and Merge requests
merge_request
:
25502
author
:
Nermin Vehabovic
type
:
changed
spec/features/issuables/sorting_list_spec.rb
View file @
0a89c08c
...
@@ -86,26 +86,26 @@ describe 'Sort Issuable List' do
...
@@ -86,26 +86,26 @@ describe 'Sort Issuable List' do
expect
(
last_merge_request
).
to
include
(
first_created_issuable
.
title
)
expect
(
last_merge_request
).
to
include
(
first_created_issuable
.
title
)
end
end
end
end
end
context
'custom sorting'
do
context
'custom sorting'
do
let
(
:issuable_type
)
{
:merge_request
}
let
(
:issuable_type
)
{
:merge_request
}
it
'supports sorting in asc and desc order'
do
it
'supports sorting in asc and desc order'
do
visit_merge_requests_with_state
(
project
,
'open'
)
visit_merge_requests_with_state
(
project
,
'open'
)
page
.
within
(
'.issues-other-filters'
)
do
page
.
within
(
'.issues-other-filters'
)
do
click_button
(
'Created date'
)
click_button
(
'Created date'
)
click_link
(
'Last updated'
)
click_link
(
'Last updated'
)
end
end
expect
(
first_merge_request
).
to
include
(
last_updated_issuable
.
title
)
expect
(
first_merge_request
).
to
include
(
last_updated_issuable
.
title
)
expect
(
last_merge_request
).
to
include
(
first_updated_issuable
.
title
)
expect
(
last_merge_request
).
to
include
(
first_updated_issuable
.
title
)
find
(
'.issues-other-filters .filter-dropdown-container .qa-reverse-sort'
).
click
find
(
'.issues-other-filters .filter-dropdown-container .qa-reverse-sort'
).
click
expect
(
first_merge_request
).
to
include
(
first_updated_issuable
.
title
)
expect
(
first_merge_request
).
to
include
(
first_updated_issuable
.
title
)
expect
(
last_merge_request
).
to
include
(
last_updated_issuable
.
title
)
expect
(
last_merge_request
).
to
include
(
last_updated_issuable
.
title
)
end
end
end
end
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