Skip to content

Commit

Permalink
[api][webui] Add explanations for notifications
Browse files Browse the repository at this point in the history
Reordered the event for notifications for a better grouping
  • Loading branch information
Moises Deniz Aleman committed Oct 25, 2017
1 parent 680f7f4 commit 52c72df
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/api/app/models/event/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ class Base < ApplicationRecord

before_save :shorten_payload_if_necessary

EXPLANATION_FOR_NOTIFICATIONS = {
'Event::BuildFail' => 'Receive notifications of build failures for packages which you are involved in',
'Event::ServiceFail' => 'Receive notifications of source service failures for packages which you are involved in',
'Event::ReviewWanted' => 'Receive notifications of reviews created that have you as a wanted reviewer',
'Event::RequestCreate' => 'Receive notifications of requests created for projects/packages which you are involved in or watching',
'Event::RequestStatechange' => 'Receive notifications of requests state changes for projects which you are involved in or watching',
'Event::CommentForProject' => 'Receive notifications of comments created on projects which you are involved in or watching',
'Event::CommentForPackage' => 'Receive notifications of comments created on a package which you are involved in or watching its project',
'Event::CommentForRequest' => 'Receive notifications of comments created on a request which you are involved in or watching those projects'
}.freeze

class << self
attr_accessor :description
@payload_keys = nil
Expand All @@ -19,10 +30,14 @@ class << self

def notification_events
%w(
Event::RequestCreate Event::RequestStatechange
Event::CommentForProject Event::CommentForPackage
Event::CommentForRequest Event::BuildFail
Event::ReviewWanted Event::ServiceFail
Event::BuildFail
Event::ServiceFail
Event::ReviewWanted
Event::RequestCreate
Event::RequestStatechange
Event::CommentForProject
Event::CommentForPackage
Event::CommentForRequest
).map(&:constantize)
end

Expand Down

0 comments on commit 52c72df

Please sign in to comment.