diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-13 06:06:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-13 06:06:31 +0300 |
commit | d41c040fa25a8b4092843b84bf7d839591b6ee09 (patch) | |
tree | 5f7e94d2b6ac79483788eb867b3827af10f5bd82 /app | |
parent | 4689bac80c8ab86e2b37abf217cc9b3404c5255f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/graphql/types/issue_sort_enum.rb | 3 | ||||
-rw-r--r-- | app/models/issue.rb | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/graphql/types/issue_sort_enum.rb b/app/graphql/types/issue_sort_enum.rb index ad919b55481..f71dd114d1f 100644 --- a/app/graphql/types/issue_sort_enum.rb +++ b/app/graphql/types/issue_sort_enum.rb @@ -5,6 +5,9 @@ module Types class IssueSortEnum < IssuableSortEnum graphql_name 'IssueSort' description 'Values for sorting issues' + + value 'DUE_DATE_ASC', 'Due date by ascending order', value: 'due_date_asc' + value 'DUE_DATE_DESC', 'Due date by descending order', value: 'due_date_desc' end # rubocop: enable Graphql/AuthorizeTypes end diff --git a/app/models/issue.rb b/app/models/issue.rb index 372621b144d..5966db21813 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -138,8 +138,8 @@ class Issue < ApplicationRecord def self.sort_by_attribute(method, excluded_labels: []) case method.to_s when 'closest_future_date', 'closest_future_date_asc' then order_closest_future_date - when 'due_date', 'due_date_asc' then order_due_date_asc - when 'due_date_desc' then order_due_date_desc + when 'due_date', 'due_date_asc' then order_due_date_asc.with_order_id_desc + when 'due_date_desc' then order_due_date_desc.with_order_id_desc when 'relative_position', 'relative_position_asc' then order_relative_position_asc.with_order_id_desc else super |