mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
feat: power signing mode
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -17,5 +17,8 @@
|
|||||||
},
|
},
|
||||||
"[typescriptreact]": {
|
"[typescriptreact]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import { notFound } from 'next/navigation';
|
|||||||
import { Trans, msg } from '@lingui/macro';
|
import { Trans, msg } from '@lingui/macro';
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { CheckCircle2, Clock8 } from 'lucide-react';
|
import { CheckCircle2, Clock8 } from 'lucide-react';
|
||||||
import { getServerSession } from 'next-auth';
|
|
||||||
import { env } from 'next-runtime-env';
|
import { env } from 'next-runtime-env';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
@ -16,10 +15,12 @@ import { isRecipientAuthorized } from '@documenso/lib/server-only/document/is-re
|
|||||||
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
|
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
|
||||||
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
|
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
|
||||||
import { getRecipientSignatures } from '@documenso/lib/server-only/recipient/get-recipient-signatures';
|
import { getRecipientSignatures } from '@documenso/lib/server-only/recipient/get-recipient-signatures';
|
||||||
|
import { getNextInboxDocument } from '@documenso/lib/server-only/user/get-next-inbox-document';
|
||||||
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 { DocumentStatus, FieldType, RecipientRole } from '@documenso/prisma/client';
|
import { DocumentStatus, FieldType, RecipientRole } from '@documenso/prisma/client';
|
||||||
import { DocumentDownloadButton } from '@documenso/ui/components/document/document-download-button';
|
import { DocumentDownloadButton } from '@documenso/ui/components/document/document-download-button';
|
||||||
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
||||||
|
import { NextInboxItemButton } from '@documenso/ui/components/document/next-inbox-item-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';
|
||||||
import { Badge } from '@documenso/ui/primitives/badge';
|
import { Badge } from '@documenso/ui/primitives/badge';
|
||||||
@ -65,9 +66,10 @@ export default async function CompletedSigningPage({
|
|||||||
|
|
||||||
const { documentData } = document;
|
const { documentData } = document;
|
||||||
|
|
||||||
const [fields, recipient] = await Promise.all([
|
const [fields, recipient, nextInboxDocument] = await Promise.all([
|
||||||
getFieldsForToken({ token }),
|
getFieldsForToken({ token }),
|
||||||
getRecipientByToken({ token }).catch(() => null),
|
getRecipientByToken({ token }).catch(() => null),
|
||||||
|
getNextInboxDocument({ email: user?.email }).catch(() => null),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!recipient) {
|
if (!recipient) {
|
||||||
@ -95,8 +97,7 @@ export default async function CompletedSigningPage({
|
|||||||
fields.find((field) => field.type === FieldType.NAME)?.customText ||
|
fields.find((field) => field.type === FieldType.NAME)?.customText ||
|
||||||
recipient.email;
|
recipient.email;
|
||||||
|
|
||||||
const sessionData = await getServerSession();
|
const isLoggedIn = !!user;
|
||||||
const isLoggedIn = !!sessionData?.user;
|
|
||||||
const canSignUp = !isExistingUser && NEXT_PUBLIC_DISABLE_SIGNUP !== 'true';
|
const canSignUp = !isExistingUser && NEXT_PUBLIC_DISABLE_SIGNUP !== 'true';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -184,12 +185,16 @@ export default async function CompletedSigningPage({
|
|||||||
</p>
|
</p>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<div className="mt-8 flex w-full max-w-sm items-center justify-center gap-4">
|
<div
|
||||||
|
className={cn('mt-8 flex w-full items-center justify-center gap-4', {
|
||||||
|
'max-w-sm': !nextInboxDocument,
|
||||||
|
})}
|
||||||
|
>
|
||||||
<DocumentShareButton documentId={document.id} token={recipient.token} />
|
<DocumentShareButton documentId={document.id} token={recipient.token} />
|
||||||
|
|
||||||
{document.status === DocumentStatus.COMPLETED ? (
|
{document.status === DocumentStatus.COMPLETED ? (
|
||||||
<DocumentDownloadButton
|
<DocumentDownloadButton
|
||||||
className="flex-1"
|
className="flex-1 text-xs"
|
||||||
fileName={document.title}
|
fileName={document.title}
|
||||||
documentData={documentData}
|
documentData={documentData}
|
||||||
disabled={document.status !== DocumentStatus.COMPLETED}
|
disabled={document.status !== DocumentStatus.COMPLETED}
|
||||||
@ -201,6 +206,15 @@ export default async function CompletedSigningPage({
|
|||||||
documentData={documentData}
|
documentData={documentData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{isLoggedIn && nextInboxDocument && (
|
||||||
|
<NextInboxItemButton
|
||||||
|
className="text-xs"
|
||||||
|
userEmail={user?.email}
|
||||||
|
documentData={documentData}
|
||||||
|
nextInboxDocument={nextInboxDocument}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -222,7 +236,7 @@ export default async function CompletedSigningPage({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{isLoggedIn && (
|
{isLoggedIn && (
|
||||||
<Link href="/documents" className="text-documenso-700 hover:text-documenso-600">
|
<Link href="/documents" className="text-documenso-700 hover:text-documenso-600 mt-4">
|
||||||
<Trans>Go Back Home</Trans>
|
<Trans>Go Back Home</Trans>
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
|||||||
43
packages/lib/server-only/user/get-next-inbox-document.ts
Normal file
43
packages/lib/server-only/user/get-next-inbox-document.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { DocumentStatus, RecipientRole, SigningStatus } from '@prisma/client';
|
||||||
|
|
||||||
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
|
type GetNextInboxDocumentOptions = {
|
||||||
|
email: string | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getNextInboxDocument = async ({ email }: GetNextInboxDocumentOptions) => {
|
||||||
|
if (!email) {
|
||||||
|
throw new Error('User is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
return await prisma.document.findFirst({
|
||||||
|
where: {
|
||||||
|
Recipient: {
|
||||||
|
some: {
|
||||||
|
email,
|
||||||
|
signingStatus: SigningStatus.NOT_SIGNED,
|
||||||
|
role: {
|
||||||
|
not: RecipientRole.CC,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
status: { not: DocumentStatus.DRAFT },
|
||||||
|
deletedAt: null,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
createdAt: true,
|
||||||
|
title: true,
|
||||||
|
Recipient: {
|
||||||
|
where: {
|
||||||
|
email,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
token: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documentMeta: true,
|
||||||
|
},
|
||||||
|
orderBy: [{ createdAt: 'asc' }],
|
||||||
|
});
|
||||||
|
};
|
||||||
@ -220,6 +220,10 @@ msgstr "Fortsetzen"
|
|||||||
msgid "Copied to clipboard"
|
msgid "Copied to clipboard"
|
||||||
msgstr "In die Zwischenablage kopiert"
|
msgstr "In die Zwischenablage kopiert"
|
||||||
|
|
||||||
|
#: packages/ui/components/document/next-inbox-item-button.tsx:70
|
||||||
|
msgid "Created {0}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: packages/ui/primitives/document-flow/add-signature.tsx:360
|
#: packages/ui/primitives/document-flow/add-signature.tsx:360
|
||||||
msgid "Custom Text"
|
msgid "Custom Text"
|
||||||
msgstr "Benutzerdefinierter Text"
|
msgstr "Benutzerdefinierter Text"
|
||||||
@ -578,6 +582,10 @@ msgstr "Erweiterte Einstellungen anzeigen"
|
|||||||
msgid "Sign"
|
msgid "Sign"
|
||||||
msgstr "Unterschreiben"
|
msgstr "Unterschreiben"
|
||||||
|
|
||||||
|
#: packages/ui/components/document/next-inbox-item-button.tsx:58
|
||||||
|
msgid "Sign Next Document"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: packages/ui/primitives/document-flow/add-fields.tsx:742
|
#: packages/ui/primitives/document-flow/add-fields.tsx:742
|
||||||
#: packages/ui/primitives/document-flow/add-signature.tsx:323
|
#: packages/ui/primitives/document-flow/add-signature.tsx:323
|
||||||
#: packages/ui/primitives/document-flow/field-icon.tsx:52
|
#: packages/ui/primitives/document-flow/field-icon.tsx:52
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -952,7 +952,7 @@ msgstr "Webhook erstellen"
|
|||||||
msgid "Create Webhook"
|
msgid "Create Webhook"
|
||||||
msgstr "Webhook erstellen"
|
msgstr "Webhook erstellen"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:215
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:229
|
||||||
msgid "Create your account and start using state-of-the-art document signing."
|
msgid "Create your account and start using state-of-the-art document signing."
|
||||||
msgstr "Erstellen Sie Ihr Konto und beginnen Sie mit dem modernen Dokumentensignieren."
|
msgstr "Erstellen Sie Ihr Konto und beginnen Sie mit dem modernen Dokumentensignieren."
|
||||||
|
|
||||||
@ -1199,7 +1199,7 @@ msgstr "Dokument"
|
|||||||
msgid "Document All"
|
msgid "Document All"
|
||||||
msgstr "Dokument Alle"
|
msgstr "Dokument Alle"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:134
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:135
|
||||||
msgid "Document Approved"
|
msgid "Document Approved"
|
||||||
msgstr "Dokument genehmigt"
|
msgstr "Dokument genehmigt"
|
||||||
|
|
||||||
@ -1258,7 +1258,7 @@ msgstr "Dokumentmetrik"
|
|||||||
msgid "Document moved"
|
msgid "Document moved"
|
||||||
msgstr "Dokument verschoben"
|
msgstr "Dokument verschoben"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:158
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:159
|
||||||
msgid "Document no longer available to sign"
|
msgid "Document no longer available to sign"
|
||||||
msgstr "Dokument steht nicht mehr zur Unterschrift zur Verfügung"
|
msgstr "Dokument steht nicht mehr zur Unterschrift zur Verfügung"
|
||||||
|
|
||||||
@ -1278,7 +1278,7 @@ msgstr "Dokument wieder versiegelt"
|
|||||||
msgid "Document sent"
|
msgid "Document sent"
|
||||||
msgstr "Dokument gesendet"
|
msgstr "Dokument gesendet"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:132
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:133
|
||||||
msgid "Document Signed"
|
msgid "Document Signed"
|
||||||
msgstr "Dokument signiert"
|
msgstr "Dokument signiert"
|
||||||
|
|
||||||
@ -1302,7 +1302,7 @@ msgstr "Dokumenten-Upload deaktiviert aufgrund unbezahlter Rechnungen"
|
|||||||
msgid "Document uploaded"
|
msgid "Document uploaded"
|
||||||
msgstr "Dokument hochgeladen"
|
msgstr "Dokument hochgeladen"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:133
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:134
|
||||||
msgid "Document Viewed"
|
msgid "Document Viewed"
|
||||||
msgstr "Dokument angesehen"
|
msgstr "Dokument angesehen"
|
||||||
|
|
||||||
@ -1528,11 +1528,11 @@ msgstr "Geben Sie hier Ihren Text ein"
|
|||||||
msgid "Error"
|
msgid "Error"
|
||||||
msgstr "Fehler"
|
msgstr "Fehler"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:142
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:143
|
||||||
msgid "Everyone has signed"
|
msgid "Everyone has signed"
|
||||||
msgstr "Alle haben unterschrieben"
|
msgstr "Alle haben unterschrieben"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:166
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:167
|
||||||
msgid "Everyone has signed! You will receive an Email copy of the signed document."
|
msgid "Everyone has signed! You will receive an Email copy of the signed document."
|
||||||
msgstr "Alle haben unterschrieben! Sie werden eine E-Mail-Kopie des unterzeichneten Dokuments erhalten."
|
msgstr "Alle haben unterschrieben! Sie werden eine E-Mail-Kopie des unterzeichneten Dokuments erhalten."
|
||||||
|
|
||||||
@ -1620,7 +1620,7 @@ msgstr "Zurück"
|
|||||||
msgid "Go back home"
|
msgid "Go back home"
|
||||||
msgstr "Zurück nach Hause"
|
msgstr "Zurück nach Hause"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:226
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:240
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/no-longer-available.tsx:57
|
#: apps/web/src/app/(signing)/sign/[token]/no-longer-available.tsx:57
|
||||||
msgid "Go Back Home"
|
msgid "Go Back Home"
|
||||||
msgstr "Zurück nach Hause"
|
msgstr "Zurück nach Hause"
|
||||||
@ -2016,7 +2016,7 @@ msgstr "Meine Vorlagen"
|
|||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Name"
|
msgstr "Name"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:211
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:225
|
||||||
msgid "Need to sign documents?"
|
msgid "Need to sign documents?"
|
||||||
msgstr "Müssen Dokumente signieren?"
|
msgstr "Müssen Dokumente signieren?"
|
||||||
|
|
||||||
@ -2814,7 +2814,7 @@ msgstr "Unterschrift"
|
|||||||
msgid "Signatures Collected"
|
msgid "Signatures Collected"
|
||||||
msgstr "Gesammelte Unterschriften"
|
msgstr "Gesammelte Unterschriften"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:200
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:205
|
||||||
msgid "Signatures will appear once the document has been completed"
|
msgid "Signatures will appear once the document has been completed"
|
||||||
msgstr "Unterschriften erscheinen, sobald das Dokument abgeschlossen ist"
|
msgstr "Unterschriften erscheinen, sobald das Dokument abgeschlossen ist"
|
||||||
|
|
||||||
@ -3319,7 +3319,7 @@ msgstr "This document could not be duplicated at this time. Please try again."
|
|||||||
msgid "This document could not be re-sent at this time. Please try again."
|
msgid "This document could not be re-sent at this time. Please try again."
|
||||||
msgstr "This document could not be re-sent at this time. Please try again."
|
msgstr "This document could not be re-sent at this time. Please try again."
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:180
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:181
|
||||||
msgid "This document has been cancelled by the owner and is no longer available for others to sign."
|
msgid "This document has been cancelled by the owner and is no longer available for others to sign."
|
||||||
msgstr "This document has been cancelled by the owner and is no longer available for others to sign."
|
msgstr "This document has been cancelled by the owner and is no longer available for others to sign."
|
||||||
|
|
||||||
@ -3852,7 +3852,7 @@ msgstr "Angesehen"
|
|||||||
msgid "Waiting"
|
msgid "Waiting"
|
||||||
msgstr "Warten"
|
msgstr "Warten"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:150
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:151
|
||||||
msgid "Waiting for others to sign"
|
msgid "Waiting for others to sign"
|
||||||
msgstr "Warten auf andere, um zu unterschreiben"
|
msgstr "Warten auf andere, um zu unterschreiben"
|
||||||
|
|
||||||
@ -4346,7 +4346,7 @@ msgstr "Sie werden benachrichtigt und können Ihr Documenso öffentliches Profil
|
|||||||
msgid "You will now be required to enter a code from your authenticator app when signing in."
|
msgid "You will now be required to enter a code from your authenticator app when signing in."
|
||||||
msgstr "Sie müssen bei der Anmeldung jetzt einen Code von Ihrer Authenticator-App eingeben."
|
msgstr "Sie müssen bei der Anmeldung jetzt einen Code von Ihrer Authenticator-App eingeben."
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:173
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:174
|
||||||
msgid "You will receive an Email copy of the signed document once everyone has signed."
|
msgid "You will receive an Email copy of the signed document once everyone has signed."
|
||||||
msgstr "Sie erhalten eine E-Mail-Kopie des unterzeichneten Dokuments, sobald alle unterschrieben haben."
|
msgstr "Sie erhalten eine E-Mail-Kopie des unterzeichneten Dokuments, sobald alle unterschrieben haben."
|
||||||
|
|
||||||
|
|||||||
@ -215,6 +215,10 @@ msgstr "Continue"
|
|||||||
msgid "Copied to clipboard"
|
msgid "Copied to clipboard"
|
||||||
msgstr "Copied to clipboard"
|
msgstr "Copied to clipboard"
|
||||||
|
|
||||||
|
#: packages/ui/components/document/next-inbox-item-button.tsx:70
|
||||||
|
msgid "Created {0}"
|
||||||
|
msgstr "Created {0}"
|
||||||
|
|
||||||
#: packages/ui/primitives/document-flow/add-signature.tsx:360
|
#: packages/ui/primitives/document-flow/add-signature.tsx:360
|
||||||
msgid "Custom Text"
|
msgid "Custom Text"
|
||||||
msgstr "Custom Text"
|
msgstr "Custom Text"
|
||||||
@ -573,6 +577,10 @@ msgstr "Show advanced settings"
|
|||||||
msgid "Sign"
|
msgid "Sign"
|
||||||
msgstr "Sign"
|
msgstr "Sign"
|
||||||
|
|
||||||
|
#: packages/ui/components/document/next-inbox-item-button.tsx:58
|
||||||
|
msgid "Sign Next Document"
|
||||||
|
msgstr "Sign Next Document"
|
||||||
|
|
||||||
#: packages/ui/primitives/document-flow/add-fields.tsx:742
|
#: packages/ui/primitives/document-flow/add-fields.tsx:742
|
||||||
#: packages/ui/primitives/document-flow/add-signature.tsx:323
|
#: packages/ui/primitives/document-flow/add-signature.tsx:323
|
||||||
#: packages/ui/primitives/document-flow/field-icon.tsx:52
|
#: packages/ui/primitives/document-flow/field-icon.tsx:52
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -947,7 +947,7 @@ msgstr "Create webhook"
|
|||||||
msgid "Create Webhook"
|
msgid "Create Webhook"
|
||||||
msgstr "Create Webhook"
|
msgstr "Create Webhook"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:215
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:229
|
||||||
msgid "Create your account and start using state-of-the-art document signing."
|
msgid "Create your account and start using state-of-the-art document signing."
|
||||||
msgstr "Create your account and start using state-of-the-art document signing."
|
msgstr "Create your account and start using state-of-the-art document signing."
|
||||||
|
|
||||||
@ -1194,7 +1194,7 @@ msgstr "Document"
|
|||||||
msgid "Document All"
|
msgid "Document All"
|
||||||
msgstr "Document All"
|
msgstr "Document All"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:134
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:135
|
||||||
msgid "Document Approved"
|
msgid "Document Approved"
|
||||||
msgstr "Document Approved"
|
msgstr "Document Approved"
|
||||||
|
|
||||||
@ -1253,7 +1253,7 @@ msgstr "Document metrics"
|
|||||||
msgid "Document moved"
|
msgid "Document moved"
|
||||||
msgstr "Document moved"
|
msgstr "Document moved"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:158
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:159
|
||||||
msgid "Document no longer available to sign"
|
msgid "Document no longer available to sign"
|
||||||
msgstr "Document no longer available to sign"
|
msgstr "Document no longer available to sign"
|
||||||
|
|
||||||
@ -1273,7 +1273,7 @@ msgstr "Document resealed"
|
|||||||
msgid "Document sent"
|
msgid "Document sent"
|
||||||
msgstr "Document sent"
|
msgstr "Document sent"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:132
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:133
|
||||||
msgid "Document Signed"
|
msgid "Document Signed"
|
||||||
msgstr "Document Signed"
|
msgstr "Document Signed"
|
||||||
|
|
||||||
@ -1297,7 +1297,7 @@ msgstr "Document upload disabled due to unpaid invoices"
|
|||||||
msgid "Document uploaded"
|
msgid "Document uploaded"
|
||||||
msgstr "Document uploaded"
|
msgstr "Document uploaded"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:133
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:134
|
||||||
msgid "Document Viewed"
|
msgid "Document Viewed"
|
||||||
msgstr "Document Viewed"
|
msgstr "Document Viewed"
|
||||||
|
|
||||||
@ -1523,11 +1523,11 @@ msgstr "Enter your text here"
|
|||||||
msgid "Error"
|
msgid "Error"
|
||||||
msgstr "Error"
|
msgstr "Error"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:142
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:143
|
||||||
msgid "Everyone has signed"
|
msgid "Everyone has signed"
|
||||||
msgstr "Everyone has signed"
|
msgstr "Everyone has signed"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:166
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:167
|
||||||
msgid "Everyone has signed! You will receive an Email copy of the signed document."
|
msgid "Everyone has signed! You will receive an Email copy of the signed document."
|
||||||
msgstr "Everyone has signed! You will receive an Email copy of the signed document."
|
msgstr "Everyone has signed! You will receive an Email copy of the signed document."
|
||||||
|
|
||||||
@ -1615,7 +1615,7 @@ msgstr "Go Back"
|
|||||||
msgid "Go back home"
|
msgid "Go back home"
|
||||||
msgstr "Go back home"
|
msgstr "Go back home"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:226
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:240
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/no-longer-available.tsx:57
|
#: apps/web/src/app/(signing)/sign/[token]/no-longer-available.tsx:57
|
||||||
msgid "Go Back Home"
|
msgid "Go Back Home"
|
||||||
msgstr "Go Back Home"
|
msgstr "Go Back Home"
|
||||||
@ -2011,7 +2011,7 @@ msgstr "My templates"
|
|||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Name"
|
msgstr "Name"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:211
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:225
|
||||||
msgid "Need to sign documents?"
|
msgid "Need to sign documents?"
|
||||||
msgstr "Need to sign documents?"
|
msgstr "Need to sign documents?"
|
||||||
|
|
||||||
@ -2809,7 +2809,7 @@ msgstr "Signature"
|
|||||||
msgid "Signatures Collected"
|
msgid "Signatures Collected"
|
||||||
msgstr "Signatures Collected"
|
msgstr "Signatures Collected"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:200
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:205
|
||||||
msgid "Signatures will appear once the document has been completed"
|
msgid "Signatures will appear once the document has been completed"
|
||||||
msgstr "Signatures will appear once the document has been completed"
|
msgstr "Signatures will appear once the document has been completed"
|
||||||
|
|
||||||
@ -3314,7 +3314,7 @@ msgstr "This document could not be duplicated at this time. Please try again."
|
|||||||
msgid "This document could not be re-sent at this time. Please try again."
|
msgid "This document could not be re-sent at this time. Please try again."
|
||||||
msgstr "This document could not be re-sent at this time. Please try again."
|
msgstr "This document could not be re-sent at this time. Please try again."
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:180
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:181
|
||||||
msgid "This document has been cancelled by the owner and is no longer available for others to sign."
|
msgid "This document has been cancelled by the owner and is no longer available for others to sign."
|
||||||
msgstr "This document has been cancelled by the owner and is no longer available for others to sign."
|
msgstr "This document has been cancelled by the owner and is no longer available for others to sign."
|
||||||
|
|
||||||
@ -3847,7 +3847,7 @@ msgstr "Viewed"
|
|||||||
msgid "Waiting"
|
msgid "Waiting"
|
||||||
msgstr "Waiting"
|
msgstr "Waiting"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:150
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:151
|
||||||
msgid "Waiting for others to sign"
|
msgid "Waiting for others to sign"
|
||||||
msgstr "Waiting for others to sign"
|
msgstr "Waiting for others to sign"
|
||||||
|
|
||||||
@ -4341,7 +4341,7 @@ msgstr "You will get notified & be able to set up your documenso public profile
|
|||||||
msgid "You will now be required to enter a code from your authenticator app when signing in."
|
msgid "You will now be required to enter a code from your authenticator app when signing in."
|
||||||
msgstr "You will now be required to enter a code from your authenticator app when signing in."
|
msgstr "You will now be required to enter a code from your authenticator app when signing in."
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:173
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:174
|
||||||
msgid "You will receive an Email copy of the signed document once everyone has signed."
|
msgid "You will receive an Email copy of the signed document once everyone has signed."
|
||||||
msgstr "You will receive an Email copy of the signed document once everyone has signed."
|
msgstr "You will receive an Email copy of the signed document once everyone has signed."
|
||||||
|
|
||||||
|
|||||||
@ -216,6 +216,10 @@ msgstr "Continuer"
|
|||||||
msgid "Copied to clipboard"
|
msgid "Copied to clipboard"
|
||||||
msgstr "Copié dans le presse-papiers"
|
msgstr "Copié dans le presse-papiers"
|
||||||
|
|
||||||
|
#: packages/ui/components/document/next-inbox-item-button.tsx:70
|
||||||
|
msgid "Created {0}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: packages/ui/primitives/document-flow/add-signature.tsx:360
|
#: packages/ui/primitives/document-flow/add-signature.tsx:360
|
||||||
msgid "Custom Text"
|
msgid "Custom Text"
|
||||||
msgstr "Texte personnalisé"
|
msgstr "Texte personnalisé"
|
||||||
@ -574,6 +578,10 @@ msgstr "Afficher les paramètres avancés"
|
|||||||
msgid "Sign"
|
msgid "Sign"
|
||||||
msgstr "Signer"
|
msgstr "Signer"
|
||||||
|
|
||||||
|
#: packages/ui/components/document/next-inbox-item-button.tsx:58
|
||||||
|
msgid "Sign Next Document"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: packages/ui/primitives/document-flow/add-fields.tsx:742
|
#: packages/ui/primitives/document-flow/add-fields.tsx:742
|
||||||
#: packages/ui/primitives/document-flow/add-signature.tsx:323
|
#: packages/ui/primitives/document-flow/add-signature.tsx:323
|
||||||
#: packages/ui/primitives/document-flow/field-icon.tsx:52
|
#: packages/ui/primitives/document-flow/field-icon.tsx:52
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -952,7 +952,7 @@ msgstr "Créer un webhook"
|
|||||||
msgid "Create Webhook"
|
msgid "Create Webhook"
|
||||||
msgstr "Créer un Webhook"
|
msgstr "Créer un Webhook"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:215
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:229
|
||||||
msgid "Create your account and start using state-of-the-art document signing."
|
msgid "Create your account and start using state-of-the-art document signing."
|
||||||
msgstr "Créez votre compte et commencez à utiliser la signature de documents à la pointe de la technologie."
|
msgstr "Créez votre compte et commencez à utiliser la signature de documents à la pointe de la technologie."
|
||||||
|
|
||||||
@ -1199,7 +1199,7 @@ msgstr "Document"
|
|||||||
msgid "Document All"
|
msgid "Document All"
|
||||||
msgstr "Document Tout"
|
msgstr "Document Tout"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:134
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:135
|
||||||
msgid "Document Approved"
|
msgid "Document Approved"
|
||||||
msgstr "Document Approuvé"
|
msgstr "Document Approuvé"
|
||||||
|
|
||||||
@ -1258,7 +1258,7 @@ msgstr "Métriques du document"
|
|||||||
msgid "Document moved"
|
msgid "Document moved"
|
||||||
msgstr "Document déplacé"
|
msgstr "Document déplacé"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:158
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:159
|
||||||
msgid "Document no longer available to sign"
|
msgid "Document no longer available to sign"
|
||||||
msgstr "Document non disponible pour signature"
|
msgstr "Document non disponible pour signature"
|
||||||
|
|
||||||
@ -1278,7 +1278,7 @@ msgstr "Document resealé"
|
|||||||
msgid "Document sent"
|
msgid "Document sent"
|
||||||
msgstr "Document envoyé"
|
msgstr "Document envoyé"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:132
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:133
|
||||||
msgid "Document Signed"
|
msgid "Document Signed"
|
||||||
msgstr "Document signé"
|
msgstr "Document signé"
|
||||||
|
|
||||||
@ -1302,7 +1302,7 @@ msgstr "Téléchargement du document désactivé en raison de factures impayées
|
|||||||
msgid "Document uploaded"
|
msgid "Document uploaded"
|
||||||
msgstr "Document téléchargé"
|
msgstr "Document téléchargé"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:133
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:134
|
||||||
msgid "Document Viewed"
|
msgid "Document Viewed"
|
||||||
msgstr "Document consulté"
|
msgstr "Document consulté"
|
||||||
|
|
||||||
@ -1528,11 +1528,11 @@ msgstr "Entrez votre texte ici"
|
|||||||
msgid "Error"
|
msgid "Error"
|
||||||
msgstr "Erreur"
|
msgstr "Erreur"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:142
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:143
|
||||||
msgid "Everyone has signed"
|
msgid "Everyone has signed"
|
||||||
msgstr "Tout le monde a signé"
|
msgstr "Tout le monde a signé"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:166
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:167
|
||||||
msgid "Everyone has signed! You will receive an Email copy of the signed document."
|
msgid "Everyone has signed! You will receive an Email copy of the signed document."
|
||||||
msgstr "Tout le monde a signé ! Vous recevrez une copie par email du document signé."
|
msgstr "Tout le monde a signé ! Vous recevrez une copie par email du document signé."
|
||||||
|
|
||||||
@ -1620,7 +1620,7 @@ msgstr "Retourner"
|
|||||||
msgid "Go back home"
|
msgid "Go back home"
|
||||||
msgstr "Retourner à la maison"
|
msgstr "Retourner à la maison"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:226
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:240
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/no-longer-available.tsx:57
|
#: apps/web/src/app/(signing)/sign/[token]/no-longer-available.tsx:57
|
||||||
msgid "Go Back Home"
|
msgid "Go Back Home"
|
||||||
msgstr "Retourner à la maison"
|
msgstr "Retourner à la maison"
|
||||||
@ -2016,7 +2016,7 @@ msgstr "Mes modèles"
|
|||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Nom"
|
msgstr "Nom"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:211
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:225
|
||||||
msgid "Need to sign documents?"
|
msgid "Need to sign documents?"
|
||||||
msgstr "Besoin de signer des documents ?"
|
msgstr "Besoin de signer des documents ?"
|
||||||
|
|
||||||
@ -2814,7 +2814,7 @@ msgstr "Signature"
|
|||||||
msgid "Signatures Collected"
|
msgid "Signatures Collected"
|
||||||
msgstr "Signatures collectées"
|
msgstr "Signatures collectées"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:200
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:205
|
||||||
msgid "Signatures will appear once the document has been completed"
|
msgid "Signatures will appear once the document has been completed"
|
||||||
msgstr "Les signatures apparaîtront une fois le document complété"
|
msgstr "Les signatures apparaîtront une fois le document complété"
|
||||||
|
|
||||||
@ -3319,7 +3319,7 @@ msgstr "Ce document n'a pas pu être dupliqué pour le moment. Veuillez réessay
|
|||||||
msgid "This document could not be re-sent at this time. Please try again."
|
msgid "This document could not be re-sent at this time. Please try again."
|
||||||
msgstr "Ce document n'a pas pu être renvoyé pour le moment. Veuillez réessayer."
|
msgstr "Ce document n'a pas pu être renvoyé pour le moment. Veuillez réessayer."
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:180
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:181
|
||||||
msgid "This document has been cancelled by the owner and is no longer available for others to sign."
|
msgid "This document has been cancelled by the owner and is no longer available for others to sign."
|
||||||
msgstr "Ce document a été annulé par le propriétaire et n'est plus disponible pour d'autres à signer."
|
msgstr "Ce document a été annulé par le propriétaire et n'est plus disponible pour d'autres à signer."
|
||||||
|
|
||||||
@ -3852,7 +3852,7 @@ msgstr "Vu"
|
|||||||
msgid "Waiting"
|
msgid "Waiting"
|
||||||
msgstr "En attente"
|
msgstr "En attente"
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:150
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:151
|
||||||
msgid "Waiting for others to sign"
|
msgid "Waiting for others to sign"
|
||||||
msgstr "En attente que d'autres signent"
|
msgstr "En attente que d'autres signent"
|
||||||
|
|
||||||
@ -4346,7 +4346,7 @@ msgstr "Vous serez notifié et pourrez configurer votre profil public Documenso
|
|||||||
msgid "You will now be required to enter a code from your authenticator app when signing in."
|
msgid "You will now be required to enter a code from your authenticator app when signing in."
|
||||||
msgstr "Vous devrez maintenant entrer un code de votre application d'authentification lors de la connexion."
|
msgstr "Vous devrez maintenant entrer un code de votre application d'authentification lors de la connexion."
|
||||||
|
|
||||||
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:173
|
#: apps/web/src/app/(signing)/sign/[token]/complete/page.tsx:174
|
||||||
msgid "You will receive an Email copy of the signed document once everyone has signed."
|
msgid "You will receive an Email copy of the signed document once everyone has signed."
|
||||||
msgstr "Vous recevrez une copie par e-mail du document signé une fois que tout le monde aura signé."
|
msgstr "Vous recevrez une copie par e-mail du document signé une fois que tout le monde aura signé."
|
||||||
|
|
||||||
|
|||||||
77
packages/ui/components/document/next-inbox-item-button.tsx
Normal file
77
packages/ui/components/document/next-inbox-item-button.tsx
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import type { HTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
|
import { Trans } from '@lingui/macro';
|
||||||
|
import { DateTime } from 'luxon';
|
||||||
|
|
||||||
|
import type { DocumentData, Prisma } from '@documenso/prisma/client';
|
||||||
|
import { SignatureIcon } from '@documenso/ui/icons/signature';
|
||||||
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@documenso/ui/primitives/tooltip';
|
||||||
|
|
||||||
|
type GetNextInboxDocumentResult = Prisma.DocumentGetPayload<{
|
||||||
|
select: {
|
||||||
|
createdAt: true;
|
||||||
|
title: true;
|
||||||
|
Recipient: {
|
||||||
|
select: {
|
||||||
|
token: true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
documentMeta: true;
|
||||||
|
};
|
||||||
|
}> | null;
|
||||||
|
|
||||||
|
export type NextInboxItemButtonProps = HTMLAttributes<HTMLButtonElement> & {
|
||||||
|
disabled?: boolean;
|
||||||
|
documentData?: DocumentData;
|
||||||
|
userEmail: string | undefined;
|
||||||
|
nextInboxDocument: GetNextInboxDocumentResult;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const NextInboxItemButton = ({
|
||||||
|
className,
|
||||||
|
documentData,
|
||||||
|
nextInboxDocument,
|
||||||
|
userEmail,
|
||||||
|
disabled,
|
||||||
|
...props
|
||||||
|
}: NextInboxItemButtonProps) => {
|
||||||
|
const recipientToken = nextInboxDocument?.Recipient[0]?.token ?? null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger>
|
||||||
|
<Link href={'/sign/' + recipientToken}>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="outline"
|
||||||
|
className={className}
|
||||||
|
disabled={disabled || !documentData || !userEmail}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<SignatureIcon className="mr-2 h-5 w-5" />
|
||||||
|
<Trans>Sign Next Document</Trans>
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</TooltipTrigger>
|
||||||
|
|
||||||
|
<TooltipContent className="flex flex-row items-start gap-x-2 p-4">
|
||||||
|
<div className="gap-y-2">
|
||||||
|
<p className="text-foreground text-base font-semibold">{nextInboxDocument?.title}</p>
|
||||||
|
|
||||||
|
{nextInboxDocument?.createdAt && (
|
||||||
|
<p className="text-muted-foreground text-sm">
|
||||||
|
<Trans>
|
||||||
|
Created {DateTime.fromJSDate(nextInboxDocument?.createdAt).toFormat('LLL ‘yy')}
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user