TSK-1341 Remove last view (#3115)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-04-29 22:46:13 +07:00
committed by GitHub
parent 9b04d366e3
commit ae8fcf8d62
41 changed files with 204 additions and 645 deletions
+5 -36
View File
@@ -34,14 +34,6 @@ import { Writable } from './types'
import { Preference } from '@hcengineering/preference'
export * from './types'
/**
* @public
*/
export interface LastView extends Doc {
user: Ref<Account>
[key: string]: any
}
/**
* @public
*/
@@ -135,20 +127,6 @@ export interface NotificationSetting extends Preference {
enabled: boolean
}
/**
* @public
*/
export interface SpaceLastEdit extends Class<Doc> {
lastEditField: string
}
/**
* @public
*/
export interface AnotherUserNotifications extends Class<Doc> {
fields: string[]
}
/**
* @public
*/
@@ -156,11 +134,6 @@ export interface ClassCollaborators extends Class<Doc> {
fields: string[] // Ref<Account> | Ref<Employee> | Ref<Account>[] | Ref<Employee>[]
}
/**
* @public
*/
export interface TrackedDoc extends Class<Doc> {}
/**
* @public
*/
@@ -183,8 +156,8 @@ export interface DocUpdates extends Doc {
attachedTo: Ref<Doc>
attachedToClass: Ref<Class<Doc>>
hidden: boolean
lastTx: Ref<TxCUD<Doc>>
lastTxTime: Timestamp
lastTx?: Ref<TxCUD<Doc>>
lastTxTime?: Timestamp
txes: [Ref<TxCUD<Doc>>, Timestamp][]
}
@@ -198,9 +171,9 @@ export const notificationId = 'notification' as Plugin
*/
export interface NotificationClient {
docUpdatesStore: Writable<Map<Ref<Doc>, DocUpdates>>
getLastViews: () => Writable<LastView>
updateLastView: (_id: Ref<Doc>, _class: Ref<Class<Doc>>, time?: Timestamp, force?: boolean) => Promise<void>
unsubscribe: (_id: Ref<Doc>) => Promise<void>
docUpdates: Writable<DocUpdates[]>
read: (_id: Ref<Doc>) => Promise<void>
forceRead: (_id: Ref<Doc>, _class: Ref<Class<Doc>>, space: Ref<Space>) => Promise<void>
}
/**
@@ -213,15 +186,11 @@ export type NotificationClientFactoy = () => NotificationClient
*/
const notification = plugin(notificationId, {
mixin: {
SpaceLastEdit: '' as Ref<Mixin<SpaceLastEdit>>,
AnotherUserNotifications: '' as Ref<Mixin<AnotherUserNotifications>>,
ClassCollaborators: '' as Ref<Mixin<ClassCollaborators>>,
Collaborators: '' as Ref<Mixin<Collaborators>>,
TrackedDoc: '' as Ref<Mixin<TrackedDoc>>,
NotificationObjectPresenter: '' as Ref<Mixin<NotificationObjectPresenter>>
},
class: {
LastView: '' as Ref<Class<LastView>>,
Notification: '' as Ref<Class<Notification>>,
EmailNotification: '' as Ref<Class<EmailNotification>>,
NotificationType: '' as Ref<Class<NotificationType>>,