2020-06-23 00:09:42 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DraftNotes
|
|
|
|
class BaseService < ::BaseService
|
|
|
|
attr_accessor :merge_request, :current_user, :params
|
|
|
|
|
|
|
|
def initialize(merge_request, current_user, params = nil)
|
2021-04-29 21:17:54 +05:30
|
|
|
@merge_request = merge_request
|
|
|
|
@current_user = current_user
|
|
|
|
@params = params.dup
|
2020-06-23 00:09:42 +05:30
|
|
|
end
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
def merge_request_activity_counter
|
|
|
|
Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter
|
|
|
|
end
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def draft_notes
|
|
|
|
@draft_notes ||= merge_request.draft_notes.order_id_asc.authored_by(current_user)
|
|
|
|
end
|
|
|
|
|
|
|
|
def project
|
|
|
|
merge_request.target_project
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|