mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 19:51:32 +10:00
Compare commits
2 Commits
main
...
fix/templa
| Author | SHA1 | Date | |
|---|---|---|---|
| a75e71700f | |||
| d121392f74 |
@ -23,10 +23,6 @@ NEXT_PRIVATE_OIDC_CLIENT_ID=""
|
|||||||
NEXT_PRIVATE_OIDC_CLIENT_SECRET=""
|
NEXT_PRIVATE_OIDC_CLIENT_SECRET=""
|
||||||
NEXT_PRIVATE_OIDC_PROVIDER_LABEL="OIDC"
|
NEXT_PRIVATE_OIDC_PROVIDER_LABEL="OIDC"
|
||||||
NEXT_PRIVATE_OIDC_SKIP_VERIFY=""
|
NEXT_PRIVATE_OIDC_SKIP_VERIFY=""
|
||||||
# Specifies the prompt to use for OIDC signin, explicitly setting
|
|
||||||
# an empty string will omit the prompt parameter.
|
|
||||||
# See: https://www.cerberauth.com/blog/openid-connect-oauth2-prompts/
|
|
||||||
NEXT_PRIVATE_OIDC_PROMPT="login"
|
|
||||||
|
|
||||||
# [[URLS]]
|
# [[URLS]]
|
||||||
NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000"
|
NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000"
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|||||||
|
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { Trans } from '@lingui/react/macro';
|
import { Trans } from '@lingui/react/macro';
|
||||||
import type { EnvelopeItem, FieldType } from '@prisma/client';
|
import type { DocumentData, FieldType } from '@prisma/client';
|
||||||
import { ReadStatus, type Recipient, SendStatus, SigningStatus } from '@prisma/client';
|
import { ReadStatus, type Recipient, SendStatus, SigningStatus } from '@prisma/client';
|
||||||
import { base64 } from '@scure/base';
|
import { base64 } from '@scure/base';
|
||||||
import { ChevronsUpDown } from 'lucide-react';
|
import { ChevronsUpDown } from 'lucide-react';
|
||||||
@ -40,8 +40,7 @@ const DEFAULT_WIDTH_PX = MIN_WIDTH_PX * 2.5;
|
|||||||
|
|
||||||
export type ConfigureFieldsViewProps = {
|
export type ConfigureFieldsViewProps = {
|
||||||
configData: TConfigureEmbedFormSchema;
|
configData: TConfigureEmbedFormSchema;
|
||||||
presignToken?: string | undefined;
|
documentData?: DocumentData;
|
||||||
envelopeItem?: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
|
||||||
defaultValues?: Partial<TConfigureFieldsFormSchema>;
|
defaultValues?: Partial<TConfigureFieldsFormSchema>;
|
||||||
onBack?: (data: TConfigureFieldsFormSchema) => void;
|
onBack?: (data: TConfigureFieldsFormSchema) => void;
|
||||||
onSubmit: (data: TConfigureFieldsFormSchema) => void;
|
onSubmit: (data: TConfigureFieldsFormSchema) => void;
|
||||||
@ -49,8 +48,7 @@ export type ConfigureFieldsViewProps = {
|
|||||||
|
|
||||||
export const ConfigureFieldsView = ({
|
export const ConfigureFieldsView = ({
|
||||||
configData,
|
configData,
|
||||||
presignToken,
|
documentData,
|
||||||
envelopeItem,
|
|
||||||
defaultValues,
|
defaultValues,
|
||||||
onBack,
|
onBack,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
@ -84,25 +82,17 @@ export const ConfigureFieldsView = ({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const normalizedDocumentData = useMemo(() => {
|
const normalizedDocumentData = useMemo(() => {
|
||||||
if (envelopeItem) {
|
if (documentData) {
|
||||||
return undefined;
|
return documentData.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!configData.documentData) {
|
if (!configData.documentData) {
|
||||||
return undefined;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return base64.encode(configData.documentData.data);
|
return base64.encode(configData.documentData.data);
|
||||||
}, [configData.documentData]);
|
}, [configData.documentData]);
|
||||||
|
|
||||||
const normalizedEnvelopeItem = useMemo(() => {
|
|
||||||
if (envelopeItem) {
|
|
||||||
return envelopeItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
return { id: '', envelopeId: '' };
|
|
||||||
}, [envelopeItem]);
|
|
||||||
|
|
||||||
const recipients = useMemo(() => {
|
const recipients = useMemo(() => {
|
||||||
return configData.signers.map<Recipient>((signer, index) => ({
|
return configData.signers.map<Recipient>((signer, index) => ({
|
||||||
id: signer.nativeId || index,
|
id: signer.nativeId || index,
|
||||||
@ -544,11 +534,14 @@ export const ConfigureFieldsView = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
|
{normalizedDocumentData && (
|
||||||
<div>
|
<div>
|
||||||
<PDFViewer
|
<PDFViewer
|
||||||
presignToken={presignToken}
|
|
||||||
overrideData={normalizedDocumentData}
|
overrideData={normalizedDocumentData}
|
||||||
envelopeItem={normalizedEnvelopeItem}
|
envelopeItem={{
|
||||||
|
id: '',
|
||||||
|
envelopeId: '',
|
||||||
|
}}
|
||||||
token={undefined}
|
token={undefined}
|
||||||
version="signed"
|
version="signed"
|
||||||
/>
|
/>
|
||||||
@ -557,7 +550,9 @@ export const ConfigureFieldsView = ({
|
|||||||
target={`${PDF_VIEWER_PAGE_SELECTOR}[data-page-number="${highestPageNumber}"]`}
|
target={`${PDF_VIEWER_PAGE_SELECTOR}[data-page-number="${highestPageNumber}"]`}
|
||||||
>
|
>
|
||||||
{localFields.map((field, index) => {
|
{localFields.map((field, index) => {
|
||||||
const recipientIndex = recipients.findIndex((r) => r.id === field.recipientId);
|
const recipientIndex = recipients.findIndex(
|
||||||
|
(r) => r.id === field.recipientId,
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FieldItem
|
<FieldItem
|
||||||
@ -588,6 +583,7 @@ export const ConfigureFieldsView = ({
|
|||||||
})}
|
})}
|
||||||
</ElementVisible>
|
</ElementVisible>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { msg } from '@lingui/core/macro';
|
|||||||
import { Trans, useLingui } from '@lingui/react/macro';
|
import { Trans, useLingui } from '@lingui/react/macro';
|
||||||
import { FieldType, RecipientRole } from '@prisma/client';
|
import { FieldType, RecipientRole } from '@prisma/client';
|
||||||
import { FileTextIcon } from 'lucide-react';
|
import { FileTextIcon } from 'lucide-react';
|
||||||
import { Link, useSearchParams } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
import { isDeepEqual } from 'remeda';
|
import { isDeepEqual } from 'remeda';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
@ -65,8 +65,6 @@ const FieldSettingsTypeTranslations: Record<FieldType, MessageDescriptor> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const EnvelopeEditorFieldsPage = () => {
|
export const EnvelopeEditorFieldsPage = () => {
|
||||||
const [searchParams] = useSearchParams();
|
|
||||||
|
|
||||||
const { envelope, editorFields, relativePath } = useCurrentEnvelopeEditor();
|
const { envelope, editorFields, relativePath } = useCurrentEnvelopeEditor();
|
||||||
|
|
||||||
const { currentEnvelopeItem } = useCurrentEnvelopeRender();
|
const { currentEnvelopeItem } = useCurrentEnvelopeRender();
|
||||||
@ -210,37 +208,6 @@ export const EnvelopeEditorFieldsPage = () => {
|
|||||||
<section>
|
<section>
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
|
|
||||||
{searchParams.get('devmode') && (
|
|
||||||
<>
|
|
||||||
<div className="px-4">
|
|
||||||
<h3 className="text-foreground mb-3 text-sm font-semibold">
|
|
||||||
<Trans>Developer Mode</Trans>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="bg-muted/50 border-border text-foreground space-y-2 rounded-md border p-3 text-sm">
|
|
||||||
<p>
|
|
||||||
<span className="text-muted-foreground min-w-12">Pos X: </span>
|
|
||||||
{selectedField.positionX.toFixed(2)}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span className="text-muted-foreground min-w-12">Pos Y: </span>
|
|
||||||
{selectedField.positionY.toFixed(2)}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span className="text-muted-foreground min-w-12">Width: </span>
|
|
||||||
{selectedField.width.toFixed(2)}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span className="text-muted-foreground min-w-12">Height: </span>
|
|
||||||
{selectedField.height.toFixed(2)}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Separator className="my-4" />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="[&_label]:text-foreground/70 px-4 [&_label]:text-xs">
|
<div className="[&_label]:text-foreground/70 px-4 [&_label]:text-xs">
|
||||||
<h3 className="text-sm font-semibold">
|
<h3 className="text-sm font-semibold">
|
||||||
{t(FieldSettingsTypeTranslations[selectedField.type])}
|
{t(FieldSettingsTypeTranslations[selectedField.type])}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ export default function EnvelopeEditorHeader() {
|
|||||||
<nav className="bg-background border-border w-full border-b px-4 py-3 md:px-6">
|
<nav className="bg-background border-border w-full border-b px-4 py-3 md:px-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center space-x-4">
|
<div className="flex items-center space-x-4">
|
||||||
<Link to="/">
|
<Link to={relativePath.basePath}>
|
||||||
<BrandingLogo className="h-6 w-auto" />
|
<BrandingLogo className="h-6 w-auto" />
|
||||||
</Link>
|
</Link>
|
||||||
<Separator orientation="vertical" className="h-6" />
|
<Separator orientation="vertical" className="h-6" />
|
||||||
|
|||||||
@ -22,12 +22,14 @@ import { useDebouncedValue } from '@documenso/lib/client-only/hooks/use-debounce
|
|||||||
import { useCurrentEnvelopeEditor } from '@documenso/lib/client-only/providers/envelope-editor-provider';
|
import { useCurrentEnvelopeEditor } from '@documenso/lib/client-only/providers/envelope-editor-provider';
|
||||||
import { useCurrentOrganisation } from '@documenso/lib/client-only/providers/organisation';
|
import { useCurrentOrganisation } from '@documenso/lib/client-only/providers/organisation';
|
||||||
import { useSession } from '@documenso/lib/client-only/providers/session';
|
import { useSession } from '@documenso/lib/client-only/providers/session';
|
||||||
|
import { isTemplateRecipientEmailPlaceholder } from '@documenso/lib/constants/template';
|
||||||
import {
|
import {
|
||||||
ZRecipientActionAuthTypesSchema,
|
ZRecipientActionAuthTypesSchema,
|
||||||
ZRecipientAuthOptionsSchema,
|
ZRecipientAuthOptionsSchema,
|
||||||
} from '@documenso/lib/types/document-auth';
|
} from '@documenso/lib/types/document-auth';
|
||||||
import { nanoid } from '@documenso/lib/universal/id';
|
import { nanoid } from '@documenso/lib/universal/id';
|
||||||
import { canRecipientBeModified as utilCanRecipientBeModified } from '@documenso/lib/utils/recipients';
|
import { canRecipientBeModified as utilCanRecipientBeModified } from '@documenso/lib/utils/recipients';
|
||||||
|
import { generateRecipientPlaceholder } from '@documenso/lib/utils/templates';
|
||||||
import { trpc } from '@documenso/trpc/react';
|
import { trpc } from '@documenso/trpc/react';
|
||||||
import { AnimateGenericFadeInOut } from '@documenso/ui/components/animate/animate-generic-fade-in-out';
|
import { AnimateGenericFadeInOut } from '@documenso/ui/components/animate/animate-generic-fade-in-out';
|
||||||
import { RecipientActionAuthSelect } from '@documenso/ui/components/recipient/recipient-action-auth-select';
|
import { RecipientActionAuthSelect } from '@documenso/ui/components/recipient/recipient-action-auth-select';
|
||||||
@ -82,7 +84,8 @@ const ZEnvelopeRecipientsForm = z.object({
|
|||||||
type TEnvelopeRecipientsForm = z.infer<typeof ZEnvelopeRecipientsForm>;
|
type TEnvelopeRecipientsForm = z.infer<typeof ZEnvelopeRecipientsForm>;
|
||||||
|
|
||||||
export const EnvelopeEditorRecipientForm = () => {
|
export const EnvelopeEditorRecipientForm = () => {
|
||||||
const { envelope, setRecipientsDebounced, updateEnvelope } = useCurrentEnvelopeEditor();
|
const { envelope, setRecipientsDebounced, updateEnvelope, isTemplate } =
|
||||||
|
useCurrentEnvelopeEditor();
|
||||||
|
|
||||||
const organisation = useCurrentOrganisation();
|
const organisation = useCurrentOrganisation();
|
||||||
|
|
||||||
@ -119,6 +122,7 @@ export const EnvelopeEditorRecipientForm = () => {
|
|||||||
role: RecipientRole.SIGNER,
|
role: RecipientRole.SIGNER,
|
||||||
signingOrder: 1,
|
signingOrder: 1,
|
||||||
actionAuth: [],
|
actionAuth: [],
|
||||||
|
...(isTemplate ? generateRecipientPlaceholder(1) : {}),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -234,6 +238,8 @@ export const EnvelopeEditorRecipientForm = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onAddSigner = () => {
|
const onAddSigner = () => {
|
||||||
|
const placeholderRecipientCount = signers.length > 1 ? signers.length + 1 : 2;
|
||||||
|
|
||||||
appendSigner({
|
appendSigner({
|
||||||
formId: nanoid(12),
|
formId: nanoid(12),
|
||||||
name: '',
|
name: '',
|
||||||
@ -241,7 +247,10 @@ export const EnvelopeEditorRecipientForm = () => {
|
|||||||
role: RecipientRole.SIGNER,
|
role: RecipientRole.SIGNER,
|
||||||
actionAuth: [],
|
actionAuth: [],
|
||||||
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
||||||
|
...(isTemplate ? generateRecipientPlaceholder(placeholderRecipientCount) : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void form.trigger('signers');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRemoveSigner = (index: number) => {
|
const onRemoveSigner = (index: number) => {
|
||||||
@ -806,7 +815,7 @@ export const EnvelopeEditorRecipientForm = () => {
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{!showAdvancedSettings && index === 0 && (
|
{!showAdvancedSettings && index === 0 && (
|
||||||
<FormLabel required>
|
<FormLabel required={!isTemplate}>
|
||||||
<Trans>Email</Trans>
|
<Trans>Email</Trans>
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
)}
|
)}
|
||||||
@ -815,7 +824,12 @@ export const EnvelopeEditorRecipientForm = () => {
|
|||||||
<RecipientAutoCompleteInput
|
<RecipientAutoCompleteInput
|
||||||
type="email"
|
type="email"
|
||||||
placeholder={t`Email`}
|
placeholder={t`Email`}
|
||||||
value={field.value}
|
value={
|
||||||
|
isTemplate &&
|
||||||
|
isTemplateRecipientEmailPlaceholder(field.value)
|
||||||
|
? ''
|
||||||
|
: field.value
|
||||||
|
}
|
||||||
disabled={
|
disabled={
|
||||||
snapshot.isDragging ||
|
snapshot.isDragging ||
|
||||||
isSubmitting ||
|
isSubmitting ||
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { Trans } from '@lingui/react/macro';
|
import { Trans } from '@lingui/react/macro';
|
||||||
import { DocumentStatus, FieldType, RecipientRole } from '@prisma/client';
|
import { DocumentStatus, FieldType, RecipientRole } from '@prisma/client';
|
||||||
import { CheckCircle2, Clock8, DownloadIcon, Loader2 } from 'lucide-react';
|
import { CheckCircle2, Clock8, DownloadIcon } from 'lucide-react';
|
||||||
import { Link } from 'react-router';
|
import { Link, useRevalidator } from 'react-router';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||||
@ -16,7 +18,7 @@ import { getRecipientSignatures } from '@documenso/lib/server-only/recipient/get
|
|||||||
import { getUserByEmail } from '@documenso/lib/server-only/user/get-user-by-email';
|
import { getUserByEmail } from '@documenso/lib/server-only/user/get-user-by-email';
|
||||||
import { isDocumentCompleted } from '@documenso/lib/utils/document';
|
import { isDocumentCompleted } from '@documenso/lib/utils/document';
|
||||||
import { env } from '@documenso/lib/utils/env';
|
import { env } from '@documenso/lib/utils/env';
|
||||||
import { trpc } from '@documenso/trpc/react';
|
import type { Document } from '@documenso/prisma/types/document-legacy-schema';
|
||||||
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
||||||
import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
@ -82,13 +84,6 @@ export async function loader({ params, request }: Route.LoaderArgs) {
|
|||||||
|
|
||||||
const canSignUp = !isExistingUser && env('NEXT_PUBLIC_DISABLE_SIGNUP') !== 'true';
|
const canSignUp = !isExistingUser && env('NEXT_PUBLIC_DISABLE_SIGNUP') !== 'true';
|
||||||
|
|
||||||
const canRedirectToFolder =
|
|
||||||
user && document.userId === user.id && document.folderId && document.team?.url;
|
|
||||||
|
|
||||||
const returnToHomePath = canRedirectToFolder
|
|
||||||
? `/t/${document.team.url}/documents/f/${document.folderId}`
|
|
||||||
: '/';
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isDocumentAccessValid: true,
|
isDocumentAccessValid: true,
|
||||||
canSignUp,
|
canSignUp,
|
||||||
@ -97,7 +92,6 @@ export async function loader({ params, request }: Route.LoaderArgs) {
|
|||||||
signatures,
|
signatures,
|
||||||
document,
|
document,
|
||||||
recipient,
|
recipient,
|
||||||
returnToHomePath,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,27 +109,8 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
document,
|
document,
|
||||||
recipient,
|
recipient,
|
||||||
recipientEmail,
|
recipientEmail,
|
||||||
returnToHomePath,
|
|
||||||
} = loaderData;
|
} = loaderData;
|
||||||
|
|
||||||
// Poll signing status every few seconds
|
|
||||||
const { data: signingStatusData } = trpc.envelope.signingStatus.useQuery(
|
|
||||||
{
|
|
||||||
token: recipient?.token || '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
refetchInterval: 3000,
|
|
||||||
initialData: match(document?.status)
|
|
||||||
.with(DocumentStatus.COMPLETED, () => ({ status: 'COMPLETED' }) as const)
|
|
||||||
.with(DocumentStatus.REJECTED, () => ({ status: 'REJECTED' }) as const)
|
|
||||||
.with(DocumentStatus.PENDING, () => ({ status: 'PENDING' }) as const)
|
|
||||||
.otherwise(() => ({ status: 'PENDING' }) as const),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// Use signing status from query if available, otherwise fall back to document status
|
|
||||||
const signingStatus = signingStatusData?.status ?? 'PENDING';
|
|
||||||
|
|
||||||
if (!isDocumentAccessValid) {
|
if (!isDocumentAccessValid) {
|
||||||
return <DocumentSigningAuthPageView email={recipientEmail} />;
|
return <DocumentSigningAuthPageView email={recipientEmail} />;
|
||||||
}
|
}
|
||||||
@ -143,7 +118,7 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'-mx-4 flex flex-col items-center overflow-hidden px-4 pt-16 md:-mx-8 md:px-8 lg:pt-20 xl:pt-28',
|
'-mx-4 flex flex-col items-center overflow-hidden px-4 pt-24 md:-mx-8 md:px-8 lg:pt-36 xl:pt-44',
|
||||||
{ 'pt-0 lg:pt-0 xl:pt-0': canSignUp },
|
{ 'pt-0 lg:pt-0 xl:pt-0': canSignUp },
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@ -177,8 +152,8 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
{recipient.role === RecipientRole.APPROVER && <Trans>Document Approved</Trans>}
|
{recipient.role === RecipientRole.APPROVER && <Trans>Document Approved</Trans>}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{match({ status: signingStatus, deletedAt: document.deletedAt })
|
{match({ status: document.status, deletedAt: document.deletedAt })
|
||||||
.with({ status: 'COMPLETED' }, () => (
|
.with({ status: DocumentStatus.COMPLETED }, () => (
|
||||||
<div className="text-documenso-700 mt-4 flex items-center text-center">
|
<div className="text-documenso-700 mt-4 flex items-center text-center">
|
||||||
<CheckCircle2 className="mr-2 h-5 w-5" />
|
<CheckCircle2 className="mr-2 h-5 w-5" />
|
||||||
<span className="text-sm">
|
<span className="text-sm">
|
||||||
@ -186,14 +161,6 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
.with({ status: 'PROCESSING' }, () => (
|
|
||||||
<div className="mt-4 flex items-center text-center text-orange-600">
|
|
||||||
<Loader2 className="mr-2 h-5 w-5 animate-spin" />
|
|
||||||
<span className="text-sm">
|
|
||||||
<Trans>Processing document</Trans>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
.with({ deletedAt: null }, () => (
|
.with({ deletedAt: null }, () => (
|
||||||
<div className="mt-4 flex items-center text-center text-blue-600">
|
<div className="mt-4 flex items-center text-center text-blue-600">
|
||||||
<Clock8 className="mr-2 h-5 w-5" />
|
<Clock8 className="mr-2 h-5 w-5" />
|
||||||
@ -211,22 +178,14 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{match({ status: signingStatus, deletedAt: document.deletedAt })
|
{match({ status: document.status, deletedAt: document.deletedAt })
|
||||||
.with({ status: 'COMPLETED' }, () => (
|
.with({ status: DocumentStatus.COMPLETED }, () => (
|
||||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||||
<Trans>
|
<Trans>
|
||||||
Everyone has signed! You will receive an Email copy of the signed document.
|
Everyone has signed! You will receive an Email copy of the signed document.
|
||||||
</Trans>
|
</Trans>
|
||||||
</p>
|
</p>
|
||||||
))
|
))
|
||||||
.with({ status: 'PROCESSING' }, () => (
|
|
||||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
|
||||||
<Trans>
|
|
||||||
All recipients have signed. The document is being processed and you will receive
|
|
||||||
an Email copy shortly.
|
|
||||||
</Trans>
|
|
||||||
</p>
|
|
||||||
))
|
|
||||||
.with({ deletedAt: null }, () => (
|
.with({ deletedAt: null }, () => (
|
||||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||||
<Trans>
|
<Trans>
|
||||||
@ -243,35 +202,23 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
</p>
|
</p>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<div className="mt-8 flex w-full max-w-xs flex-col items-stretch gap-4 md:w-auto md:max-w-none md:flex-row md:items-center">
|
<div className="mt-8 flex w-full max-w-sm items-center justify-center gap-4">
|
||||||
<DocumentShareButton
|
<DocumentShareButton documentId={document.id} token={recipient.token} />
|
||||||
documentId={document.id}
|
|
||||||
token={recipient.token}
|
|
||||||
className="w-full max-w-none md:flex-1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{isDocumentCompleted(document) && (
|
{isDocumentCompleted(document.status) && (
|
||||||
<EnvelopeDownloadDialog
|
<EnvelopeDownloadDialog
|
||||||
envelopeId={document.envelopeId}
|
envelopeId={document.envelopeId}
|
||||||
envelopeStatus={document.status}
|
envelopeStatus={document.status}
|
||||||
envelopeItems={document.envelopeItems}
|
envelopeItems={document.envelopeItems}
|
||||||
token={recipient?.token}
|
token={recipient?.token}
|
||||||
trigger={
|
trigger={
|
||||||
<Button type="button" variant="outline" className="flex-1 md:flex-initial">
|
<Button type="button" variant="outline" className="flex-1">
|
||||||
<DownloadIcon className="mr-2 h-5 w-5" />
|
<DownloadIcon className="mr-2 h-5 w-5" />
|
||||||
<Trans>Download</Trans>
|
<Trans>Download</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{user && (
|
|
||||||
<Button asChild>
|
|
||||||
<Link to={returnToHomePath}>
|
|
||||||
<Trans>Go Back Home</Trans>
|
|
||||||
</Link>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -291,8 +238,41 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
|||||||
<ClaimAccount defaultName={recipientName} defaultEmail={recipient.email} />
|
<ClaimAccount defaultName={recipientName} defaultEmail={recipient.email} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{user && (
|
||||||
|
<Link to="/" className="text-documenso-700 hover:text-documenso-600 mt-2">
|
||||||
|
<Trans>Go Back Home</Trans>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<PollUntilDocumentCompleted document={document} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type PollUntilDocumentCompletedProps = {
|
||||||
|
document: Pick<Document, 'id' | 'status' | 'deletedAt'>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const PollUntilDocumentCompleted = ({ document }: PollUntilDocumentCompletedProps) => {
|
||||||
|
const { revalidate } = useRevalidator();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isDocumentCompleted(document.status)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
if (window.document.hasFocus()) {
|
||||||
|
void revalidate();
|
||||||
|
}
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [document.status]);
|
||||||
|
|
||||||
|
return <></>;
|
||||||
|
};
|
||||||
|
|||||||
@ -75,7 +75,6 @@ export const loader = async ({ request, params }: Route.LoaderArgs) => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
token,
|
|
||||||
document: {
|
document: {
|
||||||
...document,
|
...document,
|
||||||
fields,
|
fields,
|
||||||
@ -87,7 +86,7 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
|||||||
const { _ } = useLingui();
|
const { _ } = useLingui();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const { document, token } = useLoaderData<typeof loader>();
|
const { document } = useLoaderData<typeof loader>();
|
||||||
|
|
||||||
const [hasFinishedInit, setHasFinishedInit] = useState(false);
|
const [hasFinishedInit, setHasFinishedInit] = useState(false);
|
||||||
|
|
||||||
@ -322,8 +321,7 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
|||||||
|
|
||||||
<ConfigureFieldsView
|
<ConfigureFieldsView
|
||||||
configData={configuration!}
|
configData={configuration!}
|
||||||
presignToken={token}
|
documentData={document.documentData}
|
||||||
envelopeItem={document.envelopeItems[0]}
|
|
||||||
defaultValues={fields ?? undefined}
|
defaultValues={fields ?? undefined}
|
||||||
onBack={canGoBack ? handleBackToConfig : undefined}
|
onBack={canGoBack ? handleBackToConfig : undefined}
|
||||||
onSubmit={handleConfigureFieldsSubmit}
|
onSubmit={handleConfigureFieldsSubmit}
|
||||||
|
|||||||
@ -75,7 +75,6 @@ export const loader = async ({ request, params }: Route.LoaderArgs) => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
token,
|
|
||||||
template: {
|
template: {
|
||||||
...template,
|
...template,
|
||||||
fields,
|
fields,
|
||||||
@ -87,7 +86,7 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
|||||||
const { _ } = useLingui();
|
const { _ } = useLingui();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const { template, token } = useLoaderData<typeof loader>();
|
const { template } = useLoaderData<typeof loader>();
|
||||||
|
|
||||||
const [hasFinishedInit, setHasFinishedInit] = useState(false);
|
const [hasFinishedInit, setHasFinishedInit] = useState(false);
|
||||||
|
|
||||||
@ -322,8 +321,7 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
|||||||
|
|
||||||
<ConfigureFieldsView
|
<ConfigureFieldsView
|
||||||
configData={configuration!}
|
configData={configuration!}
|
||||||
presignToken={token}
|
documentData={template.templateDocumentData}
|
||||||
envelopeItem={template.envelopeItems[0]}
|
|
||||||
defaultValues={fields ?? undefined}
|
defaultValues={fields ?? undefined}
|
||||||
onBack={canGoBack ? handleBackToConfig : undefined}
|
onBack={canGoBack ? handleBackToConfig : undefined}
|
||||||
onSubmit={handleConfigureFieldsSubmit}
|
onSubmit={handleConfigureFieldsSubmit}
|
||||||
|
|||||||
@ -106,5 +106,5 @@
|
|||||||
"vite-plugin-babel-macros": "^1.0.6",
|
"vite-plugin-babel-macros": "^1.0.6",
|
||||||
"vite-tsconfig-paths": "^5.1.4"
|
"vite-tsconfig-paths": "^5.1.4"
|
||||||
},
|
},
|
||||||
"version": "2.0.14"
|
"version": "2.0.12"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import { Hono } from 'hono';
|
|||||||
import { getOptionalSession } from '@documenso/auth/server/lib/utils/get-session';
|
import { getOptionalSession } from '@documenso/auth/server/lib/utils/get-session';
|
||||||
import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
|
import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
|
||||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||||
import { verifyEmbeddingPresignToken } from '@documenso/lib/server-only/embedding-presign/verify-embedding-presign-token';
|
|
||||||
import { getTeamById } from '@documenso/lib/server-only/team/get-team';
|
import { getTeamById } from '@documenso/lib/server-only/team/get-team';
|
||||||
import { putNormalizedPdfFileServerSide } from '@documenso/lib/universal/upload/put-file.server';
|
import { putNormalizedPdfFileServerSide } from '@documenso/lib/universal/upload/put-file.server';
|
||||||
import { getPresignPostUrl } from '@documenso/lib/universal/upload/server-actions';
|
import { getPresignPostUrl } from '@documenso/lib/universal/upload/server-actions';
|
||||||
@ -17,7 +16,6 @@ import {
|
|||||||
type TGetPresignedPostUrlResponse,
|
type TGetPresignedPostUrlResponse,
|
||||||
ZGetEnvelopeItemFileDownloadRequestParamsSchema,
|
ZGetEnvelopeItemFileDownloadRequestParamsSchema,
|
||||||
ZGetEnvelopeItemFileRequestParamsSchema,
|
ZGetEnvelopeItemFileRequestParamsSchema,
|
||||||
ZGetEnvelopeItemFileRequestQuerySchema,
|
|
||||||
ZGetEnvelopeItemFileTokenDownloadRequestParamsSchema,
|
ZGetEnvelopeItemFileTokenDownloadRequestParamsSchema,
|
||||||
ZGetEnvelopeItemFileTokenRequestParamsSchema,
|
ZGetEnvelopeItemFileTokenRequestParamsSchema,
|
||||||
ZGetPresignedPostUrlRequestSchema,
|
ZGetPresignedPostUrlRequestSchema,
|
||||||
@ -70,24 +68,12 @@ export const filesRoute = new Hono<HonoEnv>()
|
|||||||
.get(
|
.get(
|
||||||
'/envelope/:envelopeId/envelopeItem/:envelopeItemId',
|
'/envelope/:envelopeId/envelopeItem/:envelopeItemId',
|
||||||
sValidator('param', ZGetEnvelopeItemFileRequestParamsSchema),
|
sValidator('param', ZGetEnvelopeItemFileRequestParamsSchema),
|
||||||
sValidator('query', ZGetEnvelopeItemFileRequestQuerySchema),
|
|
||||||
async (c) => {
|
async (c) => {
|
||||||
const { envelopeId, envelopeItemId } = c.req.valid('param');
|
const { envelopeId, envelopeItemId } = c.req.valid('param');
|
||||||
const { token } = c.req.query();
|
|
||||||
|
|
||||||
const session = await getOptionalSession(c);
|
const session = await getOptionalSession(c);
|
||||||
|
|
||||||
let userId = session.user?.id;
|
if (!session.user) {
|
||||||
|
|
||||||
if (token) {
|
|
||||||
const presignToken = await verifyEmbeddingPresignToken({
|
|
||||||
token,
|
|
||||||
}).catch(() => undefined);
|
|
||||||
|
|
||||||
userId = presignToken?.userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!userId) {
|
|
||||||
return c.json({ error: 'Unauthorized' }, 401);
|
return c.json({ error: 'Unauthorized' }, 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +104,7 @@ export const filesRoute = new Hono<HonoEnv>()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const team = await getTeamById({
|
const team = await getTeamById({
|
||||||
userId: userId,
|
userId: session.user.id,
|
||||||
teamId: envelope.teamId,
|
teamId: envelope.teamId,
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
@ -36,14 +36,6 @@ export type TGetEnvelopeItemFileRequestParams = z.infer<
|
|||||||
typeof ZGetEnvelopeItemFileRequestParamsSchema
|
typeof ZGetEnvelopeItemFileRequestParamsSchema
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const ZGetEnvelopeItemFileRequestQuerySchema = z.object({
|
|
||||||
token: z.string().optional(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type TGetEnvelopeItemFileRequestQuery = z.infer<
|
|
||||||
typeof ZGetEnvelopeItemFileRequestQuerySchema
|
|
||||||
>;
|
|
||||||
|
|
||||||
export const ZGetEnvelopeItemFileTokenRequestParamsSchema = z.object({
|
export const ZGetEnvelopeItemFileTokenRequestParamsSchema = z.object({
|
||||||
token: z.string().min(1),
|
token: z.string().min(1),
|
||||||
envelopeItemId: z.string().min(1),
|
envelopeItemId: z.string().min(1),
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@documenso/root",
|
"name": "@documenso/root",
|
||||||
"version": "2.0.14",
|
"version": "2.0.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@documenso/root",
|
"name": "@documenso/root",
|
||||||
"version": "2.0.14",
|
"version": "2.0.12",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"apps/*",
|
"apps/*",
|
||||||
"packages/*"
|
"packages/*"
|
||||||
@ -101,7 +101,7 @@
|
|||||||
},
|
},
|
||||||
"apps/remix": {
|
"apps/remix": {
|
||||||
"name": "@documenso/remix",
|
"name": "@documenso/remix",
|
||||||
"version": "2.0.14",
|
"version": "2.0.12",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cantoo/pdf-lib": "^2.5.2",
|
"@cantoo/pdf-lib": "^2.5.2",
|
||||||
"@documenso/api": "*",
|
"@documenso/api": "*",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.0.14",
|
"version": "2.0.12",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"dev": "turbo run dev --filter=@documenso/remix",
|
"dev": "turbo run dev --filter=@documenso/remix",
|
||||||
|
|||||||
@ -27,13 +27,13 @@ type HandleOAuthAuthorizeUrlOptions = {
|
|||||||
/**
|
/**
|
||||||
* Optional prompt to pass to the authorization endpoint.
|
* Optional prompt to pass to the authorization endpoint.
|
||||||
*/
|
*/
|
||||||
prompt?: 'none' | 'login' | 'consent' | 'select_account';
|
prompt?: 'login' | 'consent' | 'select_account';
|
||||||
};
|
};
|
||||||
|
|
||||||
const oauthCookieMaxAge = 60 * 10; // 10 minutes.
|
const oauthCookieMaxAge = 60 * 10; // 10 minutes.
|
||||||
|
|
||||||
export const handleOAuthAuthorizeUrl = async (options: HandleOAuthAuthorizeUrlOptions) => {
|
export const handleOAuthAuthorizeUrl = async (options: HandleOAuthAuthorizeUrlOptions) => {
|
||||||
const { c, clientOptions, redirectPath } = options;
|
const { c, clientOptions, redirectPath, prompt = 'login' } = options;
|
||||||
|
|
||||||
if (!clientOptions.clientId || !clientOptions.clientSecret) {
|
if (!clientOptions.clientId || !clientOptions.clientSecret) {
|
||||||
throw new AppError(AppErrorCode.NOT_SETUP);
|
throw new AppError(AppErrorCode.NOT_SETUP);
|
||||||
@ -63,11 +63,7 @@ export const handleOAuthAuthorizeUrl = async (options: HandleOAuthAuthorizeUrlOp
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Pass the prompt to the authorization endpoint.
|
// Pass the prompt to the authorization endpoint.
|
||||||
if (process.env.NEXT_PRIVATE_OIDC_PROMPT !== '') {
|
|
||||||
const prompt = process.env.NEXT_PRIVATE_OIDC_PROMPT ?? 'login';
|
|
||||||
|
|
||||||
url.searchParams.append('prompt', prompt);
|
url.searchParams.append('prompt', prompt);
|
||||||
}
|
|
||||||
|
|
||||||
setCookie(c, `${clientOptions.id}_oauth_state`, state, {
|
setCookie(c, `${clientOptions.id}_oauth_state`, state, {
|
||||||
...sessionCookieOptions,
|
...sessionCookieOptions,
|
||||||
|
|||||||
@ -1,17 +1,6 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export const SUPPORTED_LANGUAGE_CODES = [
|
export const SUPPORTED_LANGUAGE_CODES = ['de', 'en', 'fr', 'es', 'it', 'pl'] as const;
|
||||||
'de',
|
|
||||||
'en',
|
|
||||||
'fr',
|
|
||||||
'es',
|
|
||||||
'it',
|
|
||||||
'pl',
|
|
||||||
'pt-BR',
|
|
||||||
'ja',
|
|
||||||
'ko',
|
|
||||||
'zh',
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
|
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
|
||||||
|
|
||||||
@ -65,22 +54,6 @@ export const SUPPORTED_LANGUAGES: Record<string, SupportedLanguage> = {
|
|||||||
short: 'pl',
|
short: 'pl',
|
||||||
full: 'Polish',
|
full: 'Polish',
|
||||||
},
|
},
|
||||||
'pt-BR': {
|
|
||||||
short: 'pt-BR',
|
|
||||||
full: 'Portuguese (Brazil)',
|
|
||||||
},
|
|
||||||
ja: {
|
|
||||||
short: 'ja',
|
|
||||||
full: 'Japanese',
|
|
||||||
},
|
|
||||||
ko: {
|
|
||||||
short: 'ko',
|
|
||||||
full: 'Korean',
|
|
||||||
},
|
|
||||||
zh: {
|
|
||||||
short: 'zh',
|
|
||||||
full: 'Chinese',
|
|
||||||
},
|
|
||||||
} satisfies Record<SupportedLanguageCodes, SupportedLanguage>;
|
} satisfies Record<SupportedLanguageCodes, SupportedLanguage>;
|
||||||
|
|
||||||
export const isValidLanguageCode = (code: unknown): code is SupportedLanguageCodes =>
|
export const isValidLanguageCode = (code: unknown): code is SupportedLanguageCodes =>
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import { signPdf } from '@documenso/signing';
|
|||||||
|
|
||||||
import { AppError, AppErrorCode } from '../../../errors/app-error';
|
import { AppError, AppErrorCode } from '../../../errors/app-error';
|
||||||
import { sendCompletedEmail } from '../../../server-only/document/send-completed-email';
|
import { sendCompletedEmail } from '../../../server-only/document/send-completed-email';
|
||||||
|
import PostHogServerClient from '../../../server-only/feature-flags/get-post-hog-server-client';
|
||||||
import { getAuditLogsPdf } from '../../../server-only/htmltopdf/get-audit-logs-pdf';
|
import { getAuditLogsPdf } from '../../../server-only/htmltopdf/get-audit-logs-pdf';
|
||||||
import { getCertificatePdf } from '../../../server-only/htmltopdf/get-certificate-pdf';
|
import { getCertificatePdf } from '../../../server-only/htmltopdf/get-certificate-pdf';
|
||||||
import { addRejectionStampToPdf } from '../../../server-only/pdf/add-rejection-stamp-to-pdf';
|
import { addRejectionStampToPdf } from '../../../server-only/pdf/add-rejection-stamp-to-pdf';
|
||||||
@ -61,7 +62,6 @@ export const run = async ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { documentId, sendEmail = true, isResealing = false, requestMetadata } = payload;
|
const { documentId, sendEmail = true, isResealing = false, requestMetadata } = payload;
|
||||||
|
|
||||||
const { envelopeId, envelopeStatus, isRejected } = await io.runTask('seal-document', async () => {
|
|
||||||
const envelope = await prisma.envelope.findFirstOrThrow({
|
const envelope = await prisma.envelope.findFirstOrThrow({
|
||||||
where: {
|
where: {
|
||||||
type: EnvelopeType.DOCUMENT,
|
type: EnvelopeType.DOCUMENT,
|
||||||
@ -102,7 +102,24 @@ export const run = async ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let envelopeItems = envelope.envelopeItems;
|
// Seems silly but we need to do this in case the job is re-ran
|
||||||
|
// after it has already run through the update task further below.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
const documentStatus = await io.runTask('get-document-status', async () => {
|
||||||
|
return envelope.status;
|
||||||
|
});
|
||||||
|
|
||||||
|
// This is the same case as above.
|
||||||
|
let envelopeItems = await io.runTask(
|
||||||
|
'get-document-data-id',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
async () => {
|
||||||
|
// eslint-disable-next-line unused-imports/no-unused-vars
|
||||||
|
return envelope.envelopeItems.map(({ field, ...rest }) => ({
|
||||||
|
...rest,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (envelopeItems.length < 1) {
|
if (envelopeItems.length < 1) {
|
||||||
throw new Error(`Document ${envelope.id} has no envelope items`);
|
throw new Error(`Document ${envelope.id} has no envelope items`);
|
||||||
@ -172,9 +189,44 @@ export const run = async ({
|
|||||||
settings,
|
settings,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// !: The commented out code is our desired implementation but we're seemingly
|
||||||
|
// !: running into issues with inngest parallelism in production.
|
||||||
|
// !: Until this is resolved we will do this sequentially which is slower but
|
||||||
|
// !: will actually work.
|
||||||
|
// const decoratePromises: Array<Promise<{ oldDocumentDataId: string; newDocumentDataId: string }>> =
|
||||||
|
// [];
|
||||||
|
|
||||||
|
// for (const envelopeItem of envelopeItems) {
|
||||||
|
// const task = io.runTask(`decorate-${envelopeItem.id}`, async () => {
|
||||||
|
// const envelopeItemFields = envelope.envelopeItems.find(
|
||||||
|
// (item) => item.id === envelopeItem.id,
|
||||||
|
// )?.field;
|
||||||
|
|
||||||
|
// if (!envelopeItemFields) {
|
||||||
|
// throw new Error(`Envelope item fields not found for envelope item ${envelopeItem.id}`);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return decorateAndSignPdf({
|
||||||
|
// envelope,
|
||||||
|
// envelopeItem,
|
||||||
|
// envelopeItemFields,
|
||||||
|
// isRejected,
|
||||||
|
// rejectionReason,
|
||||||
|
// certificateData,
|
||||||
|
// auditLogData,
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
// decoratePromises.push(task);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const newDocumentData = await Promise.all(decoratePromises);
|
||||||
|
|
||||||
|
// TODO: Remove once parallelization is working
|
||||||
const newDocumentData: Array<{ oldDocumentDataId: string; newDocumentDataId: string }> = [];
|
const newDocumentData: Array<{ oldDocumentDataId: string; newDocumentDataId: string }> = [];
|
||||||
|
|
||||||
for (const envelopeItem of envelopeItems) {
|
for (const envelopeItem of envelopeItems) {
|
||||||
|
const result = await io.runTask(`decorate-${envelopeItem.id}`, async () => {
|
||||||
const envelopeItemFields = envelope.envelopeItems.find(
|
const envelopeItemFields = envelope.envelopeItems.find(
|
||||||
(item) => item.id === envelopeItem.id,
|
(item) => item.id === envelopeItem.id,
|
||||||
)?.field;
|
)?.field;
|
||||||
@ -183,7 +235,7 @@ export const run = async ({
|
|||||||
throw new Error(`Envelope item fields not found for envelope item ${envelopeItem.id}`);
|
throw new Error(`Envelope item fields not found for envelope item ${envelopeItem.id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await decorateAndSignPdf({
|
return decorateAndSignPdf({
|
||||||
envelope,
|
envelope,
|
||||||
envelopeItem,
|
envelopeItem,
|
||||||
envelopeItemFields,
|
envelopeItemFields,
|
||||||
@ -192,10 +244,25 @@ export const run = async ({
|
|||||||
certificateData,
|
certificateData,
|
||||||
auditLogData,
|
auditLogData,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
newDocumentData.push(result);
|
newDocumentData.push(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const postHog = PostHogServerClient();
|
||||||
|
|
||||||
|
if (postHog) {
|
||||||
|
postHog.capture({
|
||||||
|
distinctId: nanoid(),
|
||||||
|
event: 'App: Document Sealed',
|
||||||
|
properties: {
|
||||||
|
documentId: envelope.id,
|
||||||
|
isRejected,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await io.runTask('update-document', async () => {
|
||||||
await prisma.$transaction(async (tx) => {
|
await prisma.$transaction(async (tx) => {
|
||||||
for (const { oldDocumentDataId, newDocumentDataId } of newDocumentData) {
|
for (const { oldDocumentDataId, newDocumentDataId } of newDocumentData) {
|
||||||
const newData = await tx.documentData.findFirstOrThrow({
|
const newData = await tx.documentData.findFirstOrThrow({
|
||||||
@ -237,24 +304,18 @@ export const run = async ({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
envelopeId: envelope.id,
|
|
||||||
envelopeStatus: envelope.status,
|
|
||||||
isRejected,
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await io.runTask('send-completed-email', async () => {
|
await io.runTask('send-completed-email', async () => {
|
||||||
let shouldSendCompletedEmail = sendEmail && !isResealing && !isRejected;
|
let shouldSendCompletedEmail = sendEmail && !isResealing && !isRejected;
|
||||||
|
|
||||||
if (isResealing && !isDocumentCompleted(envelopeStatus)) {
|
if (isResealing && !isDocumentCompleted(envelope.status)) {
|
||||||
shouldSendCompletedEmail = sendEmail;
|
shouldSendCompletedEmail = sendEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldSendCompletedEmail) {
|
if (shouldSendCompletedEmail) {
|
||||||
await sendCompletedEmail({
|
await sendCompletedEmail({
|
||||||
id: { type: 'envelopeId', id: envelopeId },
|
id: { type: 'envelopeId', id: envelope.id },
|
||||||
requestMetadata,
|
requestMetadata,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -262,7 +323,7 @@ export const run = async ({
|
|||||||
|
|
||||||
const updatedEnvelope = await prisma.envelope.findFirstOrThrow({
|
const updatedEnvelope = await prisma.envelope.findFirstOrThrow({
|
||||||
where: {
|
where: {
|
||||||
id: envelopeId,
|
id: envelope.id,
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
documentMeta: true,
|
documentMeta: true,
|
||||||
|
|||||||
@ -103,7 +103,6 @@ export const getDocumentAndSenderByToken = async ({
|
|||||||
select: {
|
select: {
|
||||||
name: true,
|
name: true,
|
||||||
teamEmail: true,
|
teamEmail: true,
|
||||||
url: true,
|
|
||||||
teamGlobalSettings: {
|
teamGlobalSettings: {
|
||||||
select: {
|
select: {
|
||||||
brandingEnabled: true,
|
brandingEnabled: true,
|
||||||
|
|||||||
@ -31,16 +31,26 @@ export const viewedDocument = async ({
|
|||||||
type: EnvelopeType.DOCUMENT,
|
type: EnvelopeType.DOCUMENT,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
envelope: {
|
||||||
|
include: {
|
||||||
|
documentMeta: true,
|
||||||
|
recipients: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!recipient) {
|
if (!recipient) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { envelope } = recipient;
|
||||||
|
|
||||||
await prisma.documentAuditLog.create({
|
await prisma.documentAuditLog.create({
|
||||||
data: createDocumentAuditLogData({
|
data: createDocumentAuditLogData({
|
||||||
type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_VIEWED,
|
type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_VIEWED,
|
||||||
envelopeId: recipient.envelopeId,
|
envelopeId: envelope.id,
|
||||||
user: {
|
user: {
|
||||||
name: recipient.name,
|
name: recipient.name,
|
||||||
email: recipient.email,
|
email: recipient.email,
|
||||||
@ -76,7 +86,7 @@ export const viewedDocument = async ({
|
|||||||
await tx.documentAuditLog.create({
|
await tx.documentAuditLog.create({
|
||||||
data: createDocumentAuditLogData({
|
data: createDocumentAuditLogData({
|
||||||
type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_OPENED,
|
type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_OPENED,
|
||||||
envelopeId: recipient.envelopeId,
|
envelopeId: envelope.id,
|
||||||
user: {
|
user: {
|
||||||
name: recipient.name,
|
name: recipient.name,
|
||||||
email: recipient.email,
|
email: recipient.email,
|
||||||
@ -93,16 +103,6 @@ export const viewedDocument = async ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const envelope = await prisma.envelope.findUniqueOrThrow({
|
|
||||||
where: {
|
|
||||||
id: recipient.envelopeId,
|
|
||||||
},
|
|
||||||
include: {
|
|
||||||
documentMeta: true,
|
|
||||||
recipients: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
await triggerWebhook({
|
await triggerWebhook({
|
||||||
event: WebhookTriggerEvents.DOCUMENT_OPENED,
|
event: WebhookTriggerEvents.DOCUMENT_OPENED,
|
||||||
data: ZWebhookDocumentSchema.parse(mapEnvelopeToWebhookDocumentPayload(envelope)),
|
data: ZWebhookDocumentSchema.parse(mapEnvelopeToWebhookDocumentPayload(envelope)),
|
||||||
|
|||||||
@ -8,7 +8,7 @@ msgstr ""
|
|||||||
"Language: pl\n"
|
"Language: pl\n"
|
||||||
"Project-Id-Version: documenso-app\n"
|
"Project-Id-Version: documenso-app\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"PO-Revision-Date: 2025-11-20 02:32\n"
|
"PO-Revision-Date: 2025-11-17 02:33\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: Polish\n"
|
"Language-Team: Polish\n"
|
||||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
||||||
@ -179,7 +179,7 @@ msgstr "Sprawdź i {recipientActionVerb} dokument utworzony przez zespół {0}"
|
|||||||
#: apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx
|
#: apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx
|
||||||
#: apps/remix/app/components/general/document/document-upload-button-legacy.tsx
|
#: apps/remix/app/components/general/document/document-upload-button-legacy.tsx
|
||||||
msgid "{0} of {1} documents remaining this month."
|
msgid "{0} of {1} documents remaining this month."
|
||||||
msgstr "Pozostało {0} z {1} dokumentów w tym miesiącu."
|
msgstr "{0} z {1} dokumentów pozostałych w tym miesiącu."
|
||||||
|
|
||||||
#. placeholder {0}: table.getFilteredSelectedRowModel().rows.length
|
#. placeholder {0}: table.getFilteredSelectedRowModel().rows.length
|
||||||
#. placeholder {1}: table.getFilteredRowModel().rows.length
|
#. placeholder {1}: table.getFilteredRowModel().rows.length
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -8,17 +8,15 @@ export type EnvelopeItemPdfUrlOptions =
|
|||||||
envelopeItem: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
envelopeItem: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
||||||
token: string | undefined;
|
token: string | undefined;
|
||||||
version: 'original' | 'signed';
|
version: 'original' | 'signed';
|
||||||
presignToken?: undefined;
|
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'view';
|
type: 'view';
|
||||||
envelopeItem: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
envelopeItem: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
||||||
token: string | undefined;
|
token: string | undefined;
|
||||||
presignToken?: string | undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getEnvelopeItemPdfUrl = (options: EnvelopeItemPdfUrlOptions) => {
|
export const getEnvelopeItemPdfUrl = (options: EnvelopeItemPdfUrlOptions) => {
|
||||||
const { envelopeItem, token, type, presignToken } = options;
|
const { envelopeItem, token, type } = options;
|
||||||
|
|
||||||
const { id, envelopeId } = envelopeItem;
|
const { id, envelopeId } = envelopeItem;
|
||||||
|
|
||||||
@ -26,11 +24,11 @@ export const getEnvelopeItemPdfUrl = (options: EnvelopeItemPdfUrlOptions) => {
|
|||||||
const version = options.version;
|
const version = options.version;
|
||||||
|
|
||||||
return token
|
return token
|
||||||
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/token/${token}/envelopeItem/${id}/download/${version}${presignToken ? `?presignToken=${presignToken}` : ''}`
|
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/token/${token}/envelopeItem/${id}/download/${version}`
|
||||||
: `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/envelope/${envelopeId}/envelopeItem/${id}/download/${version}`;
|
: `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/envelope/${envelopeId}/envelopeItem/${id}/download/${version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return token
|
return token
|
||||||
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/token/${token}/envelopeItem/${id}${presignToken ? `?presignToken=${presignToken}` : ''}`
|
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/token/${token}/envelopeItem/${id}`
|
||||||
: `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/envelope/${envelopeId}/envelopeItem/${id}`;
|
: `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/envelope/${envelopeId}/envelopeItem/${id}`;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -25,7 +25,6 @@ import { redistributeEnvelopeRoute } from './redistribute-envelope';
|
|||||||
import { setEnvelopeFieldsRoute } from './set-envelope-fields';
|
import { setEnvelopeFieldsRoute } from './set-envelope-fields';
|
||||||
import { setEnvelopeRecipientsRoute } from './set-envelope-recipients';
|
import { setEnvelopeRecipientsRoute } from './set-envelope-recipients';
|
||||||
import { signEnvelopeFieldRoute } from './sign-envelope-field';
|
import { signEnvelopeFieldRoute } from './sign-envelope-field';
|
||||||
import { signingStatusEnvelopeRoute } from './signing-status-envelope';
|
|
||||||
import { updateEnvelopeRoute } from './update-envelope';
|
import { updateEnvelopeRoute } from './update-envelope';
|
||||||
import { updateEnvelopeItemsRoute } from './update-envelope-items';
|
import { updateEnvelopeItemsRoute } from './update-envelope-items';
|
||||||
import { useEnvelopeRoute } from './use-envelope';
|
import { useEnvelopeRoute } from './use-envelope';
|
||||||
@ -73,5 +72,4 @@ export const envelopeRouter = router({
|
|||||||
duplicate: duplicateEnvelopeRoute,
|
duplicate: duplicateEnvelopeRoute,
|
||||||
distribute: distributeEnvelopeRoute,
|
distribute: distributeEnvelopeRoute,
|
||||||
redistribute: redistributeEnvelopeRoute,
|
redistribute: redistributeEnvelopeRoute,
|
||||||
signingStatus: signingStatusEnvelopeRoute,
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,82 +0,0 @@
|
|||||||
import { DocumentStatus, EnvelopeType, RecipientRole, SigningStatus } from '@prisma/client';
|
|
||||||
|
|
||||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
|
||||||
import { prisma } from '@documenso/prisma';
|
|
||||||
|
|
||||||
import { maybeAuthenticatedProcedure } from '../trpc';
|
|
||||||
import {
|
|
||||||
ZSigningStatusEnvelopeRequestSchema,
|
|
||||||
ZSigningStatusEnvelopeResponseSchema,
|
|
||||||
} from './signing-status-envelope.types';
|
|
||||||
|
|
||||||
// Internal route - not intended for public API usage
|
|
||||||
export const signingStatusEnvelopeRoute = maybeAuthenticatedProcedure
|
|
||||||
.input(ZSigningStatusEnvelopeRequestSchema)
|
|
||||||
.output(ZSigningStatusEnvelopeResponseSchema)
|
|
||||||
.query(async ({ input, ctx }) => {
|
|
||||||
const { token } = input;
|
|
||||||
|
|
||||||
ctx.logger.info({
|
|
||||||
input: {
|
|
||||||
token,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const envelope = await prisma.envelope.findFirst({
|
|
||||||
where: {
|
|
||||||
type: EnvelopeType.DOCUMENT,
|
|
||||||
recipients: {
|
|
||||||
some: {
|
|
||||||
token,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
include: {
|
|
||||||
recipients: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
name: true,
|
|
||||||
email: true,
|
|
||||||
signingStatus: true,
|
|
||||||
role: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!envelope) {
|
|
||||||
throw new AppError(AppErrorCode.NOT_FOUND, {
|
|
||||||
message: 'Envelope not found',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if envelope is rejected
|
|
||||||
if (envelope.status === DocumentStatus.REJECTED) {
|
|
||||||
return {
|
|
||||||
status: 'REJECTED',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (envelope.status === DocumentStatus.COMPLETED) {
|
|
||||||
return {
|
|
||||||
status: 'COMPLETED',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const isComplete =
|
|
||||||
envelope.recipients.some((recipient) => recipient.signingStatus === SigningStatus.REJECTED) ||
|
|
||||||
envelope.recipients.every(
|
|
||||||
(recipient) =>
|
|
||||||
recipient.role === RecipientRole.CC || recipient.signingStatus === SigningStatus.SIGNED,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isComplete) {
|
|
||||||
return {
|
|
||||||
status: 'PROCESSING',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
status: 'PENDING',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import { z } from 'zod';
|
|
||||||
|
|
||||||
export const EnvelopeSigningStatus = z.enum(['PENDING', 'PROCESSING', 'COMPLETED', 'REJECTED']);
|
|
||||||
|
|
||||||
export const ZSigningStatusEnvelopeRequestSchema = z.object({
|
|
||||||
token: z.string().describe('The recipient token to check the signing status for'),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const ZSigningStatusEnvelopeResponseSchema = z.object({
|
|
||||||
status: EnvelopeSigningStatus.describe('The current signing status of the envelope'),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type TSigningStatusEnvelopeRequest = z.infer<typeof ZSigningStatusEnvelopeRequestSchema>;
|
|
||||||
export type TSigningStatusEnvelopeResponse = z.infer<typeof ZSigningStatusEnvelopeResponseSchema>;
|
|
||||||
@ -127,11 +127,11 @@ export const DocumentShareButton = ({
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
disabled={!token || !documentId}
|
disabled={!token || !documentId}
|
||||||
className={cn('h-11 w-full max-w-lg flex-1', className)}
|
className={cn('flex-1 text-[11px]', className)}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
>
|
>
|
||||||
{!isLoading && <Sparkles className="mr-2 h-5 w-5" />}
|
{!isLoading && <Sparkles className="mr-2 h-5 w-5" />}
|
||||||
<Trans>Share</Trans>
|
<Trans>Share Signature Card</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
|
|||||||
@ -56,7 +56,6 @@ export type PDFViewerProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
envelopeItem: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
envelopeItem: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
||||||
token: string | undefined;
|
token: string | undefined;
|
||||||
presignToken?: string | undefined;
|
|
||||||
version: 'original' | 'signed';
|
version: 'original' | 'signed';
|
||||||
onDocumentLoad?: (_doc: LoadedPDFDocument) => void;
|
onDocumentLoad?: (_doc: LoadedPDFDocument) => void;
|
||||||
onPageClick?: OnPDFViewerPageClick;
|
onPageClick?: OnPDFViewerPageClick;
|
||||||
@ -68,7 +67,6 @@ export const PDFViewer = ({
|
|||||||
className,
|
className,
|
||||||
envelopeItem,
|
envelopeItem,
|
||||||
token,
|
token,
|
||||||
presignToken,
|
|
||||||
version,
|
version,
|
||||||
onDocumentLoad,
|
onDocumentLoad,
|
||||||
onPageClick,
|
onPageClick,
|
||||||
@ -168,7 +166,6 @@ export const PDFViewer = ({
|
|||||||
type: 'view',
|
type: 'view',
|
||||||
envelopeItem: envelopeItem,
|
envelopeItem: envelopeItem,
|
||||||
token,
|
token,
|
||||||
presignToken,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const bytes = await fetch(documentUrl).then(async (res) => await res.arrayBuffer());
|
const bytes = await fetch(documentUrl).then(async (res) => await res.arrayBuffer());
|
||||||
|
|||||||
@ -119,7 +119,6 @@
|
|||||||
"GOOGLE_APPLICATION_CREDENTIALS",
|
"GOOGLE_APPLICATION_CREDENTIALS",
|
||||||
"E2E_TEST_AUTHENTICATE_USERNAME",
|
"E2E_TEST_AUTHENTICATE_USERNAME",
|
||||||
"E2E_TEST_AUTHENTICATE_USER_EMAIL",
|
"E2E_TEST_AUTHENTICATE_USER_EMAIL",
|
||||||
"E2E_TEST_AUTHENTICATE_USER_PASSWORD",
|
"E2E_TEST_AUTHENTICATE_USER_PASSWORD"
|
||||||
"NEXT_PRIVATE_OIDC_PROMPT"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user