The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
🎨 🧹📝 remove todos, document typing
Timur Ercan53094dd9e44d
diff --git a/apps/web/components/editor/pdf-signer.tsx b/apps/web/components/editor/pdf-signer.tsxindex 04123df19..fb4ce2224 100644--- a/apps/web/components/editor/pdf-signer.tsx+++ b/apps/web/components/editor/pdf-signer.tsx@@ -39,8 +39,7 @@ export default function PDFSigner(props: any) {}function onDialogClose(dialogResult: any) {- // todo handle signature removed from field- // todo remove free field if dialogresult is empty (or the id )+ // todo handle signature removed from field, remove free field if dialogresult is empty (or the id )if (!dialogResult && dialogField.type === "FREE_SIGNATURE") {onDeleteHandler(dialogField.id);return;diff --git a/apps/web/pages/api/documents/[id]/fields/index.ts b/apps/web/pages/api/documents/[id]/fields/index.tsindex 0e5b01f03..9a4633948 100644--- a/apps/web/pages/api/documents/[id]/fields/index.ts+++ b/apps/web/pages/api/documents/[id]/fields/index.ts@@ -5,7 +5,6 @@ import {} from "@documenso/lib/server";import prisma from "@documenso/prisma";import { NextApiRequest, NextApiResponse } from "next";-import short from "short-uuid";import { Document as PrismaDocument, FieldType } from "@prisma/client";import { getDocument } from "@documenso/lib/query";@@ -79,7 +78,6 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {positionX: +body.positionX,positionY: +body.positionY,customText: body.customText,- // todo refactor only one type of recipientIdrecipientId: body.Recipient.id,},include: {diff --git a/apps/web/pages/api/documents/[id]/send.ts b/apps/web/pages/api/documents/[id]/send.tsindex a33ad6f29..b5902c8ed 100644--- a/apps/web/pages/api/documents/[id]/send.ts+++ b/apps/web/pages/api/documents/[id]/send.ts@@ -58,8 +58,6 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {return res.status(200).send(recipients.length);}});-- // todo check if recipient has an account and show them in their inbox or something}export default defaultHandler({diff --git a/apps/web/pages/api/documents/[id]/sign.ts b/apps/web/pages/api/documents/[id]/sign.tsindex b499e9d72..620e05fc8 100644--- a/apps/web/pages/api/documents/[id]/sign.ts+++ b/apps/web/pages/api/documents/[id]/sign.ts@@ -37,7 +37,6 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {if (!document) res.status(404).end(`No document found.`);- // todo rename .document to documentImageAsBase64 or sth. like thatlet documentWithInserts = document.document;for (const signature of signaturesFromBody) {if (!signature.signatureImage && !signature.typedSignature) {diff --git a/apps/web/pages/documents/[id]/index.tsx b/apps/web/pages/documents/[id]/index.tsxindex cbc34d230..4610bc5f0 100644--- a/apps/web/pages/documents/[id]/index.tsx+++ b/apps/web/pages/documents/[id]/index.tsx@@ -120,9 +120,6 @@ export async function getServerSideProps(context: any) {context.res);- // todo optimize querys- // todo no intersection groups-return {props: {document: JSON.parse(JSON.stringify({ ...document, document: "" })),diff --git a/apps/web/pages/documents/[id]/sign.tsx b/apps/web/pages/documents/[id]/sign.tsxindex 4b8807616..37d6ad7c8 100644--- a/apps/web/pages/documents/[id]/sign.tsx+++ b/apps/web/pages/documents/[id]/sign.tsx@@ -67,8 +67,6 @@ const SignPage: NextPageWithLayout = (props: any) => {export async function getServerSideProps(context: any) {const recipientToken: string = context.query["token"];- // todo redirect to sigend of all already signed-await prisma.recipient.updateMany({where: {token: recipientToken,@@ -87,7 +85,7 @@ export async function getServerSideProps(context: any) {},});- // Document was already signed+ // Document is already signedif (recipient.Document.status === DocumentStatus.COMPLETED) {return {redirect: {@@ -97,8 +95,7 @@ export async function getServerSideProps(context: any) {};}- // Clean up unsigned free place fields from UI from previous page visits- // todo refactor free sign fields to be client side only+ // Clean up potential unsigned free place fields from UI from previous page visitsawait prisma.field.deleteMany({where: {type: { in: [FieldType.FREE_SIGNATURE] },diff --git a/packages/lib/mail/sendSigningDoneMail.ts b/packages/lib/mail/sendSigningDoneMail.tsindex d43d84d7a..f2af85c4f 100644--- a/packages/lib/mail/sendSigningDoneMail.ts+++ b/packages/lib/mail/sendSigningDoneMail.ts@@ -1,10 +1,11 @@import { sendMail } from "./sendMail";import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants";import { signingCompleteTemplate } from "@documenso/lib/mail";+import { Document as PrismaDocument } from "@prisma/client";export const sendSigningDoneMail = async (recipient: any,- document: any,+ document: PrismaDocument,user: any) => {await sendMail(diff --git a/packages/pdf/insertTextInPDF.ts b/packages/pdf/insertTextInPDF.tsindex bf6ec4f36..a05960d70 100644--- a/packages/pdf/insertTextInPDF.ts+++ b/packages/pdf/insertTextInPDF.ts@@ -26,8 +26,8 @@ export async function insertTextInPDF(const textHeight = customFont.heightAtSize(textSize);pdfPage.drawText(text, {- x: positionX, // todo adjust for exact field size- y: pdfPage.getHeight() - positionY - textHeight / 2, // todo adjust for exact field size+ x: positionX,+ y: pdfPage.getHeight() - positionY - textHeight / 2,size: textSize,font: useHandwritingFont ? customFont : helveticaFont,color: rgb(0, 0, 0),