mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 19:44:57 +02:00
Merge 9522 9513 (#8103)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com> Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com> Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com> Signed-off-by: Andrey Sobolev <haiodo@gmail.com> Co-authored-by: Denis Bykhov <bykhov.denis@gmail.com> Co-authored-by: Alexander Onnikov <aonnikov@hardcoreeng.com> Co-authored-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
co-authored by
Denis Bykhov
Alexander Onnikov
Victor Ilyushchenko
parent
9eba1cdf07
commit
05f1d8395a
+8
-3
@@ -49,10 +49,12 @@
|
||||
$documentComments as documentComments,
|
||||
documentCommentsDisplayRequested,
|
||||
documentCommentsHighlightUpdated,
|
||||
documentCommentsLocationNavigateRequested
|
||||
documentCommentsLocationNavigateRequested,
|
||||
$documentReleasedVersions as documentReleasedVersions
|
||||
} from '../../stores/editors/document'
|
||||
import DocumentTitle from './DocumentTitle.svelte'
|
||||
import DocumentPrintTitlePage from '../print/DocumentPrintTitlePage.svelte'
|
||||
import { syncDocumentMetaTitle } from '../../utils'
|
||||
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
@@ -111,14 +113,17 @@
|
||||
unsubscribeNavigateToLocation()
|
||||
})
|
||||
|
||||
const handleUpdateTitle = () => {
|
||||
const handleUpdateTitle = async () => {
|
||||
if (!$controlledDocument || !title) {
|
||||
return
|
||||
}
|
||||
const titleTrimmed = title.trim()
|
||||
|
||||
if (titleTrimmed.length > 0 && titleTrimmed !== $controlledDocument.title) {
|
||||
client.update($controlledDocument, { title: titleTrimmed })
|
||||
await client.update($controlledDocument, { title: titleTrimmed })
|
||||
if ($documentReleasedVersions.length === 0 && $controlledDocument.state === DocumentState.Draft) {
|
||||
await syncDocumentMetaTitle(client, $controlledDocument.attachedTo, $controlledDocument.code, titleTrimmed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -15,14 +15,15 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import documents, { Document } from '@hcengineering/controlled-documents'
|
||||
import documents, { ControlledDocument } from '@hcengineering/controlled-documents'
|
||||
import presentation, { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { Button, EditBox, Label } from '@hcengineering/ui'
|
||||
|
||||
import IconWarning from '../../icons/IconWarning.svelte'
|
||||
import documentsRes from '../../../plugin'
|
||||
import { syncDocumentMetaTitle } from '../../../utils'
|
||||
|
||||
export let object: Document
|
||||
export let object: ControlledDocument
|
||||
|
||||
const client = getClient()
|
||||
const dispatch = createEventDispatcher()
|
||||
@@ -59,6 +60,7 @@
|
||||
}
|
||||
|
||||
await client.update(object, { code })
|
||||
await syncDocumentMetaTitle(client, object.attachedTo, code, object.title)
|
||||
dispatch('close')
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user