fix: copy template content when creating controlled document (#6441)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-08-29 19:20:32 +07:00
committed by GitHub
parent e072f05d97
commit 46ced93bc1
4 changed files with 51 additions and 8 deletions
@@ -27,7 +27,7 @@
Ref,
SortingOrder
} from '@hcengineering/core'
import { Card, createQuery, getClient } from '@hcengineering/presentation'
import { Card, copyDocument, createQuery, getClient } from '@hcengineering/presentation'
import { createFocusManager, EditBox, FocusHandler } from '@hcengineering/ui'
import { ObjectBox } from '@hcengineering/view-resources'
import {
@@ -91,7 +91,17 @@
return
}
await createControlledDocFromTemplate(client, templateId, id, object, space, undefined, undefined, documentClass)
await createControlledDocFromTemplate(
client,
templateId,
id,
object,
space,
undefined,
undefined,
documentClass,
copyDocument
)
dispatch('close', id)
}
@@ -24,7 +24,7 @@
type Data,
type Ref
} from '@hcengineering/core'
import { MessageBox, getClient } from '@hcengineering/presentation'
import { MessageBox, copyDocument, getClient } from '@hcengineering/presentation'
import {
AnySvelteComponent,
addNotification,
@@ -160,7 +160,9 @@
docObject,
_space,
$locationStep.project,
$locationStep.parent
$locationStep.parent,
documents.class.ControlledDocument,
copyDocument
)
if (!success) {