blob: 4ad287c4a13c748bc10c502676bdec00a4e6e47f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# frozen_string_literal: true
module IssuableCollectionsAction
extend ActiveSupport::Concern
include IssuableCollections
include IssuesCalendar
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def issues
@issues = issuables_collection
.non_archived
.page(params[:page])
@issuable_meta_data = issuable_meta_data(@issues, collection_type, current_user)
respond_to do |format|
format.html
format.atom { render layout: 'xml.atom' }
end
end
def merge_requests
@merge_requests = issuables_collection.page(params[:page])
@issuable_meta_data = issuable_meta_data(@merge_requests, collection_type, current_user)
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
def issues_calendar
render_issues_calendar(issuables_collection)
end
private
def issuable_sorting_field
case action_name
when 'issues'
Issue::SORTING_PREFERENCE_FIELD
when 'merge_requests'
MergeRequest::SORTING_PREFERENCE_FIELD
else
nil
end
end
def finder_type
case action_name
when 'issues', 'issues_calendar'
IssuesFinder
when 'merge_requests'
MergeRequestsFinder
else
nil
end
end
def finder_options
super.merge(non_archived: true)
end
end
|