EZQMS-1392: Obsolete documents (#7833)

Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
Victor Ilyushchenko
2025-01-29 17:18:46 +03:00
committed by GitHub
parent 7ae937461f
commit 984c7d90ab
20 changed files with 143 additions and 23 deletions
@@ -57,9 +57,10 @@
$: inProgress = { state: { $in: [DocumentState.Draft] }, space: { $in: spaces } }
$: effective = { state: { $in: [DocumentState.Effective] }, space: { $in: spaces } }
$: archived = { state: { $in: [DocumentState.Archived, DocumentState.Deleted] }, space: { $in: spaces } }
$: obsolete = { state: { $in: [DocumentState.Obsolete] }, space: { $in: spaces } }
$: all = { space: { $in: spaces } }
$: queries = { inProgress, effective, archived, all }
$: queries = { inProgress, effective, archived, obsolete, all }
$: mode = $resolvedLocationStore.query?.mode ?? undefined
$: if (mode === undefined || (queries as any)[mode] === undefined) {
@@ -118,6 +118,7 @@
DocumentState.Archived,
DocumentState.Deleted,
DocumentState.Effective,
DocumentState.Obsolete,
ControlledDocumentState.InApproval,
ControlledDocumentState.Approved,
ControlledDocumentState.ToReview
@@ -37,11 +37,11 @@
}
&.obsolete {
background: var(--theme-state-ghost-background-color);
border-color: var(--theme-state-ghost-border-color);
background: var(--theme-state-negative-background-color);
border-color: var(--theme-state-negative-border-color);
.label {
color: var(--theme-state-ghost-color);
color: var(--theme-state-negative-color);
}
}
@@ -148,9 +148,10 @@
{@const title = doc ? getDocumentName(doc) : meta?.title ?? ''}
{@const docid = doc?._id ?? prjdoc._id}
{@const isFolder = prjdoc.document === documents.ids.Folder}
{@const isObsolete = doc ? doc.state === DocumentState.Obsolete : false}
{@const children = metaid ? childrenByParent[metaid] ?? [] : []}
{#if metaid}
{@const children = childrenByParent[metaid] ?? []}
{#if metaid && (!isObsolete || children.length > 0)}
{@const isDraggedOver = draggedOver === metaid}
<div class="flex-col relative">
{#if isDraggedOver}
@@ -160,12 +161,12 @@
_id={docid}
icon={isFolder ? documents.icon.Folder : documents.icon.Document}
iconProps={{
fill: 'currentColor'
fill: isObsolete ? 'var(--dangerous-bg-color)' : 'currentColor'
}}
{title}
selected={selected === docid || selected === prjdoc._id}
isFold
empty={children.length === 0 || children === undefined}
empty={children.length === 0}
actions={getMoreActions !== undefined ? () => getDocMoreActions(prjdoc) : undefined}
{level}
{collapsedPrefix}
@@ -38,6 +38,9 @@
case DocumentState.Archived:
statusWMLabel = plugin.string.Archived
break
case DocumentState.Obsolete:
statusWMLabel = plugin.string.Obsolete
break
}
}
@@ -51,7 +54,7 @@
$controlledDocument != null &&
(isOrgSpace
? $controlledDocument.state !== DocumentState.Effective
: ![DocumentState.Effective, DocumentState.Archived].includes($controlledDocument.state))
: ![DocumentState.Effective, DocumentState.Obsolete, DocumentState.Archived].includes($controlledDocument.state))
</script>
{#if $controlledDocument !== null}