Fix workspace event (#3542)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-08-01 19:40:26 +07:00 committed by GitHub
parent 424c546089
commit 315d20480b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 4 deletions

View File

@ -63,7 +63,17 @@ import {
import { TAccount, TSpace } from './security'
import { TStatus, TStatusCategory } from './status'
import { TUserStatus } from './transient'
import { TTx, TTxApplyIf, TTxCUD, TTxCollectionCUD, TTxCreateDoc, TTxMixin, TTxRemoveDoc, TTxUpdateDoc } from './tx'
import {
TTx,
TTxApplyIf,
TTxCUD,
TTxCollectionCUD,
TTxCreateDoc,
TTxMixin,
TTxRemoveDoc,
TTxUpdateDoc,
TTxWorkspaceEvent
} from './tx'
export { coreId } from '@hcengineering/core'
export * from './core'
@ -89,6 +99,7 @@ export function createModel (builder: Builder): void {
TTxUpdateDoc,
TTxRemoveDoc,
TTxApplyIf,
TTxWorkspaceEvent,
TSpace,
TAccount,
TAttribute,

View File

@ -33,7 +33,9 @@ import {
TxCUD,
TxMixin,
TxRemoveDoc,
TxUpdateDoc
TxUpdateDoc,
TxWorkspaceEvent,
WorkspaceEvent
} from '@hcengineering/core'
import { Hidden, Index, Model, Prop, TypeRef } from '@hcengineering/model'
import core from './component'
@ -100,3 +102,9 @@ export class TTxApplyIf extends TTx implements TxApplyIf {
notMatch!: DocumentClassQuery<Doc>[]
txes!: TxCUD<Doc>[]
}
@Model(core.class.TxWorkspaceEvent, core.class.Doc)
export class TTxWorkspaceEvent extends TTx implements TxWorkspaceEvent {
event!: WorkspaceEvent
params!: any
}

View File

@ -28,8 +28,8 @@ import { DocumentClassQuery, Tx, TxCUD, TxFactory, TxProcessor } from './tx'
export class TxOperations implements Omit<Client, 'notify'> {
readonly txFactory: TxFactory
constructor (readonly client: Client, readonly user: Ref<Account>) {
this.txFactory = new TxFactory(user)
constructor (readonly client: Client, readonly user: Ref<Account>, readonly isDerived: boolean = false) {
this.txFactory = new TxFactory(user, isDerived)
}
getHierarchy (): Hierarchy {