mirror of
https://github.com/documenso/documenso.git
synced 2026-08-24 23:32:29 +10:00
feat: add pending signed pdf downloads for recipients
Recipients can download a PDF that contains the inserted fields while the envelope is in the PENDING state. The token file route accepts the `pending` version. The PDF contains only the fields from recipients who signed and the fields of the recipient who makes the request. This is the same set of fields that the signing page shows to the recipient. The signing page and the completion page show the download dialog for pending envelopes. The dialog does not show the "Partial" button for legacy envelopes.
This commit is contained in:
@@ -148,6 +148,13 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
);
|
||||
}
|
||||
|
||||
// The envelope may complete or get rejected while this page polls, so derive
|
||||
// the download dialog status from the live signing status.
|
||||
const envelopeStatus = match(signingStatus)
|
||||
.with('COMPLETED', () => DocumentStatus.COMPLETED)
|
||||
.with('REJECTED', () => DocumentStatus.REJECTED)
|
||||
.otherwise(() => document.status);
|
||||
|
||||
return (
|
||||
<>
|
||||
<RecipientBranding branding={branding} cspNonce={cspNonce} />
|
||||
@@ -255,10 +262,11 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
className="w-full max-w-none md:flex-1"
|
||||
/>
|
||||
|
||||
{isDocumentCompleted(document) && (
|
||||
{(isDocumentCompleted(envelopeStatus) || envelopeStatus === DocumentStatus.PENDING) && (
|
||||
<EnvelopeDownloadDialog
|
||||
envelopeId={document.envelopeId}
|
||||
envelopeStatus={document.status}
|
||||
envelopeStatus={envelopeStatus}
|
||||
isLegacy={document.internalVersion === 1}
|
||||
envelopeItems={document.envelopeItems}
|
||||
token={recipient?.token}
|
||||
trigger={
|
||||
|
||||
Reference in New Issue
Block a user