Commit 914a3b24 authored by Mark Chao's avatar Mark Chao

Allow extensible mention type action for EE

parent 19211ecb
......@@ -220,6 +220,10 @@ module NotificationRecipientService
end
class Default < Base
prepend ::EE::NotificationRecipientBuilders::Default
MENTION_TYPE_ACTIONS = [:new_issue, :new_merge_request].freeze
attr_reader :target
attr_reader :current_user
attr_reader :action
......@@ -252,7 +256,7 @@ module NotificationRecipientService
add_subscribed_users
if [:new_issue, :new_merge_request].include?(custom_action)
if self.class.mention_type_actions.include?(custom_action)
# These will all be participants as well, but adding with the :mention
# type ensures that users with the mention notification level will
# receive them, too.
......@@ -283,6 +287,10 @@ module NotificationRecipientService
def custom_action
@custom_action ||= "#{action}_#{target.class.model_name.name.underscore}".to_sym
end
def self.mention_type_actions
MENTION_TYPE_ACTIONS.dup
end
end
class NewNote < Base
......
# frozen_string_literal: true
module EE
module NotificationRecipientBuilders
module Default
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override
override :mention_type_actions
def mention_type_actions
super.append(:new_epic)
end
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