2020-08-20 20:10:44 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module IssuableLinks
|
|
|
|
class ListService
|
|
|
|
include Gitlab::Routing
|
|
|
|
|
|
|
|
attr_reader :issuable, :current_user
|
|
|
|
|
|
|
|
def initialize(issuable, user)
|
2021-04-19 17:09:27 -04:00
|
|
|
@issuable = issuable
|
|
|
|
@current_user = user
|
2020-08-20 20:10:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
2021-11-04 23:12:26 -04:00
|
|
|
serializer.new(current_user: current_user, issuable: issuable)
|
|
|
|
.represent(child_issuables, serializer_options)
|
2020-08-20 20:10:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2021-11-04 23:12:26 -04:00
|
|
|
def serializer_options
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
|
2020-08-20 20:10:44 -04:00
|
|
|
def serializer
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def preload_for_collection
|
|
|
|
[{ project: :namespace }, :assignees]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|