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 @@ -66,6 +66,7 @@
$editorMode as editorMode,
editorModeUpdated,
$isDocumentOwner as isDocumentOwner,
$isDocumentOwnerOrCoAuthor as isDocumentOwnerOrCoAuthor,
$isProjectEditable as isProjectEditable,
rightPanelTabChanged
} from '../stores/editors/document'
Expand Down Expand Up @@ -118,7 +119,7 @@
void notificationClient.then((client) => client.readDoc(_id))
})

$: if (_id && _class && project) {

Check warning on line 122 in plugins/controlled-documents-resources/src/components/EditDocPanel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected object value in conditional. The condition is always true

Check warning on line 122 in plugins/controlled-documents-resources/src/components/EditDocPanel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected object value in conditional. The condition is always true

Check warning on line 122 in plugins/controlled-documents-resources/src/components/EditDocPanel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected object value in conditional. The condition is always true
controlledDocumentOpened({ _id, _class, project })
}

Expand Down Expand Up @@ -196,9 +197,9 @@
{ confirmationTitle: documentRes.string.ConfirmReviewCompletion },
eventToHTMLElement(ev),
async (res) => {
if (!res) return

Check warning on line 200 in plugins/controlled-documents-resources/src/components/EditDocPanel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected any value in conditional. An explicit comparison or type cast is required

if (!$controlledDocument || $documentState !== ControlledDocumentState.InReview) {

Check warning on line 202 in plugins/controlled-documents-resources/src/components/EditDocPanel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected nullable object value in conditional. An explicit null check is required
return
}

Expand All @@ -209,7 +210,7 @@

async function changeApprovalRequestState (ev: MouseEvent, isRejection: boolean): Promise<void> {
showPopup(SignatureDialog, { isRejection }, eventToHTMLElement(ev), async (res) => {
if (!res) return

Check warning on line 213 in plugins/controlled-documents-resources/src/components/EditDocPanel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected any value in conditional. An explicit comparison or type cast is required

if (!$controlledDocument || $documentState !== ControlledDocumentState.InApproval) {
return
Expand Down Expand Up @@ -364,7 +365,7 @@
<svelte:fragment slot="extra">
<div class="flex flex-gap-1 no-print">
{#if $isProjectEditable}
{#if $isDocumentOwner && !$documentReviewIsActive && !$documentApprovalIsActive}
{#if $isDocumentOwnerOrCoAuthor && !$documentReviewIsActive && !$documentApprovalIsActive}
{#if $canSendForReview}
<Button
label={documentRes.string.SendForReview}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ export const $isDocumentCoAuthor = $controlledDocument.map((doc) => {
return doc.coAuthors.includes(employee)
})

export const $isDocumentOwnerOrCoAuthor = combine(
$isDocumentOwner,
$isDocumentCoAuthor,
(isOwner, isCoAuthor) => isOwner || isCoAuthor
)

export const $isDocumentReviewer = $controlledDocument.map((doc) => {
if (doc == null) {
return false
Expand Down
Loading