UBERF-4725 Migrate collaborative content (#5717)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-08-22 16:03:42 +05:00
committed by GitHub
parent 0e72b85978
commit df2a9b2708
97 changed files with 702 additions and 820 deletions
+7 -3
View File
@@ -18,11 +18,12 @@ import {
type AttachedData,
type Class,
type CollaborativeDoc,
type Doc,
type Ref,
type TxOperations,
Mixin,
generateId,
getCollaborativeDoc
makeCollaborativeDoc
} from '@hcengineering/core'
import {
type Document,
@@ -33,6 +34,7 @@ import {
type DocumentMeta,
type Project,
DocumentState,
HierarchyDocument,
ProjectDocument
} from './types'
@@ -261,7 +263,7 @@ export async function createDocumentTemplate (
}
)
await ops.addCollection(
await ops.addCollection<DocumentMeta, HierarchyDocument>(
_class,
space,
metaId,
@@ -301,5 +303,7 @@ export function getCollaborativeDocForDocument (
prefix = prefix.substring(0, prefix.length - 1)
}
return getCollaborativeDoc(`${prefix}-${seqNumber}-${major}.${minor}${next ? '.next' : ''}-` + generateId())
return makeCollaborativeDoc(
(`${prefix}-${seqNumber}-${major}.${minor}${next ? '.next' : ''}-` + generateId()) as Ref<Doc>
)
}