Resolve "Customize notifications for new epic - Web and API"
The CE port is here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20793
What does this MR do?
Allow custom notification for new epic event, and implement 'new epic' email (including queue/worker/etc).
In the past, all email events are just a constant array NotificationSetting::EMAIL_EVENTS
. This is used to list the options in the modal box screenshot below. However there is a need to have group-level specific event (in this case: new_epic
), meaning this array can become dynamic. So this MR added a email_events
method which can return different events based on input source
type.
Currently there are project
or group
source types (which you can set from https://gitlab.com/profile/notifications). There is also a global
notification, where source
is nil. So in order to add source-specific events, source
is the parameter of NotificationSetting.email_events
.
As new_epic
is an EE-only group-level event, a EE::NotificationSetting
module is created to add new_epic
when email_events
is called with group source.
After this MR, when clicking on project's custom config, the list will be the same as before. However if group's custom config is opened, the new epic
will appear. Also when global custom config is opened, new epic
will also be there.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
See #5863 (closed)
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conforms to the code review guidelines
-
Has been reviewed by a UX Designer -
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
EE specific content should be in the top level /ee
folder -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #5863 (closed)