mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-31 12:49:57 +00:00
EQMS-1478: allow editing of the qms-document category in subsequent drafts (#8204)
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
parent
6db8e45d3e
commit
9d82890022
@ -14,7 +14,7 @@
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import documents, { type Document, type DocumentTemplate } from '@hcengineering/controlled-documents'
|
||||
import documents, { DocumentState, type Document, type DocumentTemplate } from '@hcengineering/controlled-documents'
|
||||
import { PersonPresenter } from '@hcengineering/contact-resources'
|
||||
import { DateRangeMode } from '@hcengineering/core'
|
||||
import { DatePresenter, Label, Scroller, eventToHTMLElement, showPopup } from '@hcengineering/ui'
|
||||
@ -73,7 +73,9 @@
|
||||
)
|
||||
}
|
||||
|
||||
$: isEditableDraft = $isEditable && $controlledDocument != null && $documentAllVersions.length === 1
|
||||
$: isEditableDraft = $isEditable && $controlledDocument != null && $controlledDocument.state === DocumentState.Draft
|
||||
$: isInitialEditableDraft = isEditableDraft && $documentAllVersions.length === 1
|
||||
|
||||
$: isTemplate =
|
||||
$controlledDocument != null && hierarchy.hasMixin($controlledDocument, documents.mixin.DocumentTemplate)
|
||||
|
||||
@ -94,7 +96,7 @@
|
||||
value={$controlledDocument}
|
||||
isRegular
|
||||
disableLink
|
||||
editable={isEditableDraft}
|
||||
editable={isInitialEditableDraft}
|
||||
on:edit={(e) => {
|
||||
handleCodeEdit(e.detail)
|
||||
}}
|
||||
@ -119,7 +121,7 @@
|
||||
|
||||
{#if isTemplate}
|
||||
<DocumentInfo label={documentsRes.string.DocumentPrefix}>
|
||||
<DocumentPrefixPresenter value={asTemplate} editable={isEditableDraft} />
|
||||
<DocumentPrefixPresenter value={asTemplate} editable={isInitialEditableDraft} />
|
||||
</DocumentInfo>
|
||||
{/if}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user