mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
@ -135,7 +135,7 @@ export default function PDFSigner(props: any) {
|
|||||||
<PDFViewer
|
<PDFViewer
|
||||||
style={{
|
style={{
|
||||||
cursor:
|
cursor:
|
||||||
signatureFields === 0
|
signatureFields.length === 0
|
||||||
? `url("https://place-hold.it/110x64/37f095/ffffff&text=Signature") 55 32, auto`
|
? `url("https://place-hold.it/110x64/37f095/ffffff&text=Signature") 55 32, auto`
|
||||||
: "",
|
: "",
|
||||||
}}
|
}}
|
||||||
@ -145,7 +145,8 @@ export default function PDFSigner(props: any) {
|
|||||||
pdfUrl={`${NEXT_PUBLIC_WEBAPP_URL}/api/documents/${router.query.id}?token=${router.query.token}`}
|
pdfUrl={`${NEXT_PUBLIC_WEBAPP_URL}/api/documents/${router.query.id}?token=${router.query.token}`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
onMouseDown={function onMouseDown(e: any, page: number) {
|
onMouseDown={function onMouseDown(e: any, page: number) {
|
||||||
if (signatureFields === 0) addFreeSignature(e, page, props.recipient);
|
if (signatureFields.length === 0)
|
||||||
|
addFreeSignature(e, page, props.recipient);
|
||||||
}}
|
}}
|
||||||
onMouseUp={() => {}}
|
onMouseUp={() => {}}
|
||||||
onDelete={onDeleteHandler}
|
onDelete={onDeleteHandler}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export default function PDFViewer(props) {
|
|||||||
></SignableField>
|
></SignableField>
|
||||||
) : (
|
) : (
|
||||||
<EditableField
|
<EditableField
|
||||||
hidden={item.Signature}
|
hidden={item.Signature || item.inserted}
|
||||||
key={item.id}
|
key={item.id}
|
||||||
field={item}
|
field={item}
|
||||||
className="absolute"
|
className="absolute"
|
||||||
|
|||||||
@ -75,6 +75,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
documentId: +documentId,
|
documentId: +documentId,
|
||||||
type: body.type,
|
type: body.type,
|
||||||
page: +body.page,
|
page: +body.page,
|
||||||
|
inserted: false,
|
||||||
positionX: +body.positionX,
|
positionX: +body.positionX,
|
||||||
positionY: +body.positionY,
|
positionY: +body.positionY,
|
||||||
customText: body.customText,
|
customText: body.customText,
|
||||||
|
|||||||
@ -82,13 +82,26 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
documentWithInserts = await insertTextInPDF(
|
documentWithInserts = await insertTextInPDF(
|
||||||
documentWithInserts,
|
documentWithInserts,
|
||||||
field.type === FieldType.DATE
|
field.type === FieldType.DATE
|
||||||
? new Date().toDateString()
|
? new Intl.DateTimeFormat("en-US", {
|
||||||
|
month: "long",
|
||||||
|
day: "numeric",
|
||||||
|
year: "numeric",
|
||||||
|
}).format(new Date())
|
||||||
: field.customText || "",
|
: field.customText || "",
|
||||||
field.positionX,
|
field.positionX,
|
||||||
field.positionY,
|
field.positionY,
|
||||||
field.page,
|
field.page,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await prisma.field.update({
|
||||||
|
where: {
|
||||||
|
id: field.id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
inserted: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await prisma.document.update({
|
await prisma.document.update({
|
||||||
|
|||||||
Reference in New Issue
Block a user