🎨 🧹📝 remove todos, document typing

This commit is contained in:
Timur Ercan
2023-03-01 14:58:31 +01:00
parent 035371bc0b
commit 53094dd9e4
8 changed files with 7 additions and 18 deletions

View File

@ -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;

View File

@ -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 recipientId
recipientId: body.Recipient.id,
},
include: {

View File

@ -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({

View File

@ -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 that
let documentWithInserts = document.document;
for (const signature of signaturesFromBody) {
if (!signature.signatureImage && !signature.typedSignature) {

View File

@ -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: "" })),

View File

@ -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 signed
if (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 visits
await prisma.field.deleteMany({
where: {
type: { in: [FieldType.FREE_SIGNATURE] },

View File

@ -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(

View File

@ -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),