mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* Add ReactionsCreate notification event type - Add ReactionsCreate to NotificationEventType enum and defaults - Add notification settings UI with SmileyIcon and proper labels - Create ReactionsCreateNotificationsTask to handle comment reactions - Update NotificationsProcessor to handle comments.add_reaction events - Add eventText and path handling in client Notification model - Notifications are enabled by default but never send emails * Applied automatic fixes * Show the actual emoji in the notification * Cleanup notifications if reaction is removed * PR feedback --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { Notification } from "@server/models";
|
|
import { APIContext } from "@server/types";
|
|
import presentUser from "./user";
|
|
import { presentComment, presentDocument } from ".";
|
|
|
|
export default async function presentNotification(
|
|
ctx: APIContext | undefined,
|
|
notification: Notification
|
|
) {
|
|
return {
|
|
id: notification.id,
|
|
viewedAt: notification.viewedAt,
|
|
archivedAt: notification.archivedAt,
|
|
createdAt: notification.createdAt,
|
|
event: notification.event,
|
|
userId: notification.userId,
|
|
actorId: notification.actorId,
|
|
actor: notification.actor ? presentUser(notification.actor) : undefined,
|
|
commentId: notification.commentId,
|
|
comment: notification.comment
|
|
? presentComment(notification.comment)
|
|
: undefined,
|
|
documentId: notification.documentId,
|
|
document: notification.document
|
|
? await presentDocument(ctx, notification.document)
|
|
: undefined,
|
|
revisionId: notification.revisionId,
|
|
collectionId: notification.collectionId,
|
|
data: notification.data,
|
|
};
|
|
}
|