Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
914a3b24
Commit
914a3b24
authored
Jul 30, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow extensible mention type action for EE
parent
19211ecb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
app/services/notification_recipient_service.rb
app/services/notification_recipient_service.rb
+9
-1
ee/app/services/ee/notification_recipient_builders/default.rb
...pp/services/ee/notification_recipient_builders/default.rb
+18
-0
No files found.
app/services/notification_recipient_service.rb
View file @
914a3b24
...
...
@@ -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
...
...
ee/app/services/ee/notification_recipient_builders/default.rb
0 → 100644
View file @
914a3b24
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment