Remove NotificationSettings table (#5036
* helper * Add script to move notification settings * wip, removal of NotificationSettings * event name * iteration * test * test * Remove last of NotificationSettings model * refactor * More fixes * snapshots * Change emails to class instances for type safety * test * docs * Update migration for self-hosted * tsc
This commit is contained in:
@@ -159,3 +159,41 @@ export type CollectionSort = {
|
||||
field: string;
|
||||
direction: "asc" | "desc";
|
||||
};
|
||||
|
||||
export enum NotificationEventType {
|
||||
PublishDocument = "documents.publish",
|
||||
UpdateDocument = "documents.update",
|
||||
CreateCollection = "collections.create",
|
||||
CreateComment = "comments.create",
|
||||
Mentioned = "comments.mentioned",
|
||||
InviteAccepted = "emails.invite_accepted",
|
||||
Onboarding = "emails.onboarding",
|
||||
Features = "emails.features",
|
||||
ExportCompleted = "emails.export_completed",
|
||||
}
|
||||
|
||||
export enum NotificationChannelType {
|
||||
App = "app",
|
||||
Email = "email",
|
||||
Chat = "chat",
|
||||
}
|
||||
|
||||
export type NotificationSettings = {
|
||||
[key in NotificationEventType]?:
|
||||
| {
|
||||
[key in NotificationChannelType]?: boolean;
|
||||
}
|
||||
| boolean;
|
||||
};
|
||||
|
||||
export const NotificationEventDefaults = {
|
||||
[NotificationEventType.PublishDocument]: false,
|
||||
[NotificationEventType.UpdateDocument]: true,
|
||||
[NotificationEventType.CreateCollection]: false,
|
||||
[NotificationEventType.CreateComment]: true,
|
||||
[NotificationEventType.Mentioned]: true,
|
||||
[NotificationEventType.InviteAccepted]: true,
|
||||
[NotificationEventType.Onboarding]: true,
|
||||
[NotificationEventType.Features]: true,
|
||||
[NotificationEventType.ExportCompleted]: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user