Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
highlightUpdateCommand,
selectNode
} from '@hcengineering/text-editor-resources'
import { EditBox, Label, Scroller } from '@hcengineering/ui'
import { Component, EditBox, Label, Scroller } from '@hcengineering/ui'
import { getCollaborationUser } from '@hcengineering/view-resources'
import { merge } from 'effector'
import { createEventDispatcher, onDestroy, tick } from 'svelte'
import activity from '@hcengineering/activity'
import plugin from '../../plugin'

import {
Expand All @@ -41,11 +42,13 @@
$controlledDocument as controlledDocument,
$documentCommentHighlightedLocation as documentCommentHighlightedLocation,
$documentComments as documentComments,
$documentState as documentState,
documentCommentsDisplayRequested,
documentCommentsLocationNavigateRequested,
documentCommentsAddCanceled,
$isEditable as isEditable
} from '../../stores/editors/document'
import { isActivityDocumentState } from '../../utils'
import DocumentPrintTitlePage from '../print/DocumentPrintTitlePage.svelte'
import DocumentTitle from './DocumentTitle.svelte'

Expand Down Expand Up @@ -276,6 +279,19 @@
return await createEmbedding(file)
}}
/>
{#if isActivityDocumentState($documentState)}
<div class="activity-container no-print">
<Component
is={activity.component.Activity}
props={{
object: $controlledDocument,
showCommenInput: true,
boundary,
focusIndex: 1000
}}
/>
</div>
{/if}
<div class="bottomSpacing no-print" />
</div>
</Scroller>
Expand Down Expand Up @@ -340,6 +356,10 @@
padding-bottom: 55vh;
}

.activity-container {
padding-top: 2rem;
}

.watermark-container {
position: absolute;
z-index: 100;
Expand Down
15 changes: 15 additions & 0 deletions plugins/controlled-documents-resources/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,14 @@ export const controlledDocumentStatesOrder = [
ControlledDocumentState.ToReview
]

const activityDocumentStates = [
DocumentState.Draft,
ControlledDocumentState.InReview,
ControlledDocumentState.Reviewed,
ControlledDocumentState.InApproval,
ControlledDocumentState.Rejected
]

export interface LoginInfo {
email: string
password: string
Expand Down Expand Up @@ -1233,3 +1241,10 @@ export async function extractValidationWorkflow (

return result
}

export function isActivityDocumentState (state: DocumentState | ControlledDocumentState | null): boolean {
if (state == null) {
return false
}
return activityDocumentStates.includes(state)
}
Loading