Refactor server side notifications (#2327)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2022-10-26 17:24:39 +07:00
committed by GitHub
parent 70e00dbb5f
commit 3a8d1e2bcb
58 changed files with 539 additions and 400 deletions
+13 -5
View File
@@ -29,6 +29,15 @@ export interface LastView extends AttachedDoc {
user: Ref<Account>
}
/**
* @public
*/
export interface NotificationAction {
component: AnyComponent
objectId: Ref<Doc>
objectClass: Ref<Class<Doc>>
}
/**
* @public
*/
@@ -39,11 +48,7 @@ export interface Notification extends AttachedDoc {
type: Ref<NotificationType>
// Defined to open particular item if required.
action?: {
component: AnyComponent
objectId: Ref<Doc>
objectClass: Ref<Class<Doc>>
}
action?: NotificationAction
}
/**
@@ -72,6 +77,9 @@ export enum NotificationStatus {
*/
export interface NotificationType extends Doc {
label: IntlString
textTemplate: string
htmlTemplate: string
subjectTemplate: string
}
/**
-16
View File
@@ -306,20 +306,6 @@ export interface IgnoreActions extends Class<Doc> {
actions: Ref<Action>[]
}
/**
* @public
*/
export interface HTMLPresenter extends Class<Doc> {
presenter: Resource<(doc: Doc) => string>
}
/**
* @public
*/
export interface TextPresenter extends Class<Doc> {
presenter: Resource<(doc: Doc) => string>
}
/**
* @public
*/
@@ -420,8 +406,6 @@ const view = plugin(viewId, {
SpaceHeader: '' as Ref<Mixin<SpaceHeader>>,
SpaceName: '' as Ref<Mixin<SpaceName>>,
IgnoreActions: '' as Ref<Mixin<IgnoreActions>>,
HTMLPresenter: '' as Ref<Mixin<HTMLPresenter>>,
TextPresenter: '' as Ref<Mixin<TextPresenter>>,
PreviewPresenter: '' as Ref<Mixin<PreviewPresenter>>
},
class: {