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 ...@@ -131,9 +131,8 @@ module IssuableCollections
end end
def finder def finder
return @finder if @finder return @finder if defined?(@finder)
@finder_type ||= finder_type
@finder = issuable_finder_for(@finder_type) @finder = issuable_finder_for(@finder_type)
end end
...@@ -143,8 +142,6 @@ module IssuableCollections ...@@ -143,8 +142,6 @@ module IssuableCollections
'Issue' 'Issue'
when MergeRequestsFinder when MergeRequestsFinder
'MergeRequest' 'MergeRequest'
when EpicsFinder
'Epic'
end end
end end
...@@ -157,8 +154,6 @@ module IssuableCollections ...@@ -157,8 +154,6 @@ module IssuableCollections
:source_project, :target_project, :author, :assignee, :labels, :milestone, :source_project, :target_project, :author, :assignee, :labels, :milestone,
head_pipeline: :project, target_project: :namespace, merge_request_diff: :merge_request_diff_commits head_pipeline: :project, target_project: :namespace, merge_request_diff: :merge_request_diff_commits
] ]
when 'Epic'
[:group, :author]
end end
end end
end end
...@@ -248,7 +248,8 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -248,7 +248,8 @@ class Projects::IssuesController < Projects::ApplicationController
Issues::UpdateService.new(project, current_user, update_params) Issues::UpdateService.new(project, current_user, update_params)
end end
def finder_type def set_issuables_index
IssuesFinder @finder_type = IssuesFinder
super
end end
end end
...@@ -329,7 +329,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -329,7 +329,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
@target_branches = @merge_request.target_project.repository.branch_names @target_branches = @merge_request.target_project.repository.branch_names
end end
def finder_type def set_issuables_index
MergeRequestsFinder @finder_type = MergeRequestsFinder
super
end end
end end
...@@ -53,7 +53,16 @@ class Groups::EpicsController < Groups::ApplicationController ...@@ -53,7 +53,16 @@ class Groups::EpicsController < Groups::ApplicationController
Epics::UpdateService.new(nil, current_user, epic_params) Epics::UpdateService.new(nil, current_user, epic_params)
end end
def finder_type def set_issuables_index
EpicsFinder @finder_type = EpicsFinder
super
end
def collection_type
@collection_type ||= 'Epic'
end
def preload_for_collection
@preload_for_collection ||= [:group, :author]
end end
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