0
0
Fork 0

Add year in review feature to web UI (#32709)

This commit is contained in:
Eugen Rochko 2024-11-05 15:40:07 +01:00 committed by GitHub
parent 20a147170e
commit d6349c0e9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1103 additions and 21 deletions

View file

@ -67,6 +67,9 @@ class Notification < ApplicationRecord
moderation_warning: {
filterable: false,
}.freeze,
annual_report: {
filterable: false,
}.freeze,
'admin.sign_up': {
filterable: false,
}.freeze,
@ -101,6 +104,7 @@ class Notification < ApplicationRecord
belongs_to :report, inverse_of: false
belongs_to :account_relationship_severance_event, inverse_of: false
belongs_to :account_warning, inverse_of: false
belongs_to :generated_annual_report, inverse_of: false
end
validates :type, inclusion: { in: TYPES }
@ -309,7 +313,7 @@ class Notification < ApplicationRecord
self.from_account_id = activity&.status&.account_id
when 'Account'
self.from_account_id = activity&.id
when 'AccountRelationshipSeveranceEvent', 'AccountWarning'
when 'AccountRelationshipSeveranceEvent', 'AccountWarning', 'GeneratedAnnualReport'
# These do not really have an originating account, but this is mandatory
# in the data model, and the recipient's account will by definition
# always exist

View file

@ -51,6 +51,7 @@ class NotificationGroup < ActiveModelSerializers::Model
:report,
:account_relationship_severance_event,
:account_warning,
:generated_annual_report,
to: :notification, prefix: false
class << self