From 90f4d02f715f1d209f837601640165bf0f9f9539 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 4 Oct 2024 23:18:40 +0500 Subject: [PATCH] Fix documents (#6816) Signed-off-by: Denis Bykhov --- dev/import-tool/src/notion.ts | 2 -- models/core/src/core.ts | 2 +- models/document/src/index.ts | 7 ++----- plugins/document-resources/src/utils.ts | 1 - plugins/document/src/types.ts | 1 - 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dev/import-tool/src/notion.ts b/dev/import-tool/src/notion.ts index a634222e6f..a25555f27b 100644 --- a/dev/import-tool/src/notion.ts +++ b/dev/import-tool/src/notion.ts @@ -338,7 +338,6 @@ async function createDBPageWithAttachments ( description: collabId, parent: parentId, attachments: 0, - children: 0, embeddings: 0, labels: 0, comments: 0, @@ -486,7 +485,6 @@ async function importPageDocument ( description: collabId, parent, attachments: 0, - children: 0, embeddings: 0, labels: 0, comments: 0, diff --git a/models/core/src/core.ts b/models/core/src/core.ts index d7bd4af27d..b7e6651995 100644 --- a/models/core/src/core.ts +++ b/models/core/src/core.ts @@ -114,7 +114,7 @@ export class TDoc extends TObj implements Doc { createdOn!: Timestamp } -@Model(core.class.Card, core.class.Obj) +@Model(core.class.Card, core.class.Doc) @UX(core.string.Object) export class TCard extends TDoc implements Card { @Prop(TypeString(), core.string.Name) diff --git a/models/document/src/index.ts b/models/document/src/index.ts index 7f4f857391..5bea148225 100644 --- a/models/document/src/index.ts +++ b/models/document/src/index.ts @@ -91,9 +91,6 @@ export class TDocument extends TCard implements Document, Todoable { @Hidden() lockedBy?: Ref - @Prop(Collection(document.class.Document), document.string.ChildDocument) - children!: CollectionSize - @Prop(Collection(document.class.DocumentEmbedding), document.string.Embeddings) embeddings?: number @@ -447,7 +444,7 @@ function defineDocument (builder: Builder): void { allowedForAuthor: false, label: document.string.Document, group: document.ids.DocumentNotificationGroup, - field: 'content', + field: 'description', txClasses: [core.class.TxUpdateDoc], objectClass: document.class.Document, defaultEnabled: false, @@ -471,7 +468,7 @@ function defineDocument (builder: Builder): void { document.class.Document, document.ids.DocumentNotificationGroup, [], - ['attachments', 'children', 'comments'] + ['attachments', 'comments'] ) // Activity & Inbox diff --git a/plugins/document-resources/src/utils.ts b/plugins/document-resources/src/utils.ts index d695ff4cea..1a62400bf9 100644 --- a/plugins/document-resources/src/utils.ts +++ b/plugins/document-resources/src/utils.ts @@ -81,7 +81,6 @@ export async function createEmptyDocument ( title, description: makeCollaborativeDoc(id, 'description'), attachments: 0, - children: 0, embeddings: 0, labels: 0, comments: 0, diff --git a/plugins/document/src/types.ts b/plugins/document/src/types.ts index 7c3c05590c..f0675ccd7f 100644 --- a/plugins/document/src/types.ts +++ b/plugins/document/src/types.ts @@ -33,7 +33,6 @@ export interface Document extends Card, IconProps { snapshots?: number attachments?: number - children?: number comments?: number embeddings?: number labels?: number