summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-05-21 17:46:12 -0500
committerBrett Walker <bwalker@gitlab.com>2019-05-28 11:36:10 -0500
commit40b67a4f6a91e718721857f4d34cc600d1f90b9b (patch)
tree97b5eb4f3850bf457125e793dff6d9a25d7eeba4 /app/controllers
parent2efc284a99e5791a486da5bfd137142d465fb38c (diff)
downloadgitlab-ce-40b67a4f6a91e718721857f4d34cc600d1f90b9b.tar.gz
Allow issues to be sorted by relative_position
- adding a "Manual" option to the dropdown - show 100 issues list when manually sorting
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/concerns/issuable_collections.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/concerns/issuable_collections.rb b/app/controllers/concerns/issuable_collections.rb
index 91e875dca54..9cf25915e92 100644
--- a/app/controllers/concerns/issuable_collections.rb
+++ b/app/controllers/concerns/issuable_collections.rb
@@ -41,6 +41,7 @@ module IssuableCollections
return if pagination_disabled?
@issuables = @issuables.page(params[:page])
+ @issuables = per_page_for_relative_position if params[:sort] == 'relative_position'
@issuable_meta_data = issuable_meta_data(@issuables, collection_type)
@total_pages = issuable_page_count
end
@@ -80,6 +81,11 @@ module IssuableCollections
(row_count.to_f / limit).ceil
end
+ # manual / relative_position sorting allows for 100 items on the page
+ def per_page_for_relative_position
+ @issuables.per(100) # rubocop:disable Gitlab/ModuleWithInstanceVariables
+ end
+
def issuable_finder_for(finder_class)
finder_class.new(current_user, finder_options)
end