Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor <idrozdov@gitlab.com>2019-04-04 19:28:56 +0300
committerDouwe Maan <douwe@gitlab.com>2019-04-04 19:28:56 +0300
commit866b58a54e95415ad74b8f004db40abb4343c753 (patch)
treeed7436c916e4d3db48c255267255e9bbc4fbaa22 /lib/gitlab/git
parent8647230fa509cbba8e1853aae500315bf1116005 (diff)
Allow to sort wiki pages by date and title
- Add controls for sorting by title and date - Execute Gitaly call which now accepts sorting params for wikis
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/wiki.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab/git/wiki.rb b/lib/gitlab/git/wiki.rb
index c43331bed60..a0dd4a24363 100644
--- a/lib/gitlab/git/wiki.rb
+++ b/lib/gitlab/git/wiki.rb
@@ -86,9 +86,9 @@ module Gitlab
end
end
- def pages(limit: 0)
+ def pages(limit: 0, sort: nil, direction_desc: false)
wrapped_gitaly_errors do
- gitaly_get_all_pages(limit: limit)
+ gitaly_get_all_pages(limit: limit, sort: sort, direction_desc: direction_desc)
end
end
@@ -168,8 +168,10 @@ module Gitlab
Gitlab::Git::WikiFile.new(wiki_file)
end
- def gitaly_get_all_pages(limit: 0)
- gitaly_wiki_client.get_all_pages(limit: limit).map do |wiki_page, version|
+ def gitaly_get_all_pages(limit: 0, sort: nil, direction_desc: false)
+ gitaly_wiki_client.get_all_pages(
+ limit: limit, sort: sort, direction_desc: direction_desc
+ ).map do |wiki_page, version|
Gitlab::Git::WikiPage.new(wiki_page, version)
end
end