mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 11:47:42 +02:00
EZQMS-1392: Obsolete documents (#7833)
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
+2
-1
@@ -21,9 +21,10 @@ export const $canCreateNewDraft = combine($controlledDocument, $documentAllVersi
|
||||
if (document == null) return false
|
||||
|
||||
const currentIndex = versions.findIndex((p) => p._id === document._id)
|
||||
const forbiddenStates = [DocumentState.Draft, DocumentState.Obsolete]
|
||||
|
||||
return (
|
||||
versions.slice(0, currentIndex).every((p) => p.state === DocumentState.Deleted) &&
|
||||
document.state !== DocumentState.Draft
|
||||
!forbiddenStates.includes(document.state)
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user