Commit c34fdda5 authored by Jarka Kadlecova's avatar Jarka Kadlecova

Simplify specifying finder, move ee specific code outside concern

parent 8c3277d6
......@@ -131,9 +131,8 @@ module IssuableCollections
end
def finder
return @finder if @finder
return @finder if defined?(@finder)
@finder_type ||= finder_type
@finder = issuable_finder_for(@finder_type)
end
......@@ -143,8 +142,6 @@ module IssuableCollections
'Issue'
when MergeRequestsFinder
'MergeRequest'
when EpicsFinder
'Epic'
end
end
......@@ -157,8 +154,6 @@ module IssuableCollections
:source_project, :target_project, :author, :assignee, :labels, :milestone,
head_pipeline: :project, target_project: :namespace, merge_request_diff: :merge_request_diff_commits
]
when 'Epic'
[:group, :author]
end
end
end
......@@ -248,7 +248,8 @@ class Projects::IssuesController < Projects::ApplicationController
Issues::UpdateService.new(project, current_user, update_params)
end
def finder_type
IssuesFinder
def set_issuables_index
@finder_type = IssuesFinder
super
end
end
......@@ -329,7 +329,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
@target_branches = @merge_request.target_project.repository.branch_names
end
def finder_type
MergeRequestsFinder
def set_issuables_index
@finder_type = MergeRequestsFinder
super
end
end
......@@ -53,7 +53,16 @@ class Groups::EpicsController < Groups::ApplicationController
Epics::UpdateService.new(nil, current_user, epic_params)
end
def finder_type
EpicsFinder
def set_issuables_index
@finder_type = EpicsFinder
super
end
def collection_type
@collection_type ||= 'Epic'
end
def preload_for_collection
@preload_for_collection ||= [:group, :author]
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment