Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/OpenSign/src/routes/LoadMf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function RemoteApp({ app }) {
width: "100%",
overflow: "hidden",
borderRadius: 3,
minHeight: "70vh"
height: "100%",
minHeight: "100vh"
}}
>
{RemoteComponent && <RemoteComponent />}
Expand Down
33 changes: 19 additions & 14 deletions apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,20 @@ async function sendCompletedMail(e) {
},
});
}
async function sendDoctoWebhook(t) {
var e;
async function sendDoctoWebhook(t, e) {
t.data.ExtUserPtr?.Webhook &&
((e = {
File: t?.data?.SignedUrl,
File: e || '',
Name: t?.data?.Name,
Note: t?.data?.Note,
Description: t?.data?.Description,
Signers: t?.data?.Signers?.map(e => e.Name),
Note: t?.data?.Note || '',
Description: t?.data?.Description || '',
Signers: t?.data?.Signers?.map(e => ({ Name: e.Name, Email: e.Email, Phone: e.Phone })) || [
{
Name: t?.data?.ExtUserPtr?.Name,
Email: t?.data?.ExtUserPtr?.Email,
Phone: t?.data?.ExtUserPtr?.Phone,
},
],
Completed: !0,
CompletedAt: new Date(),
CreatedAt: t?.data?.createdAt,
Expand Down Expand Up @@ -217,17 +222,17 @@ async function PDF(i, o) {
(n.data.Signers && 0 < n.data.Signers.length && y.length !== n.data.Signers.length) ||
!(t = !0)
);
var v,
P,
var P,
v,
x = `./exports/exported_file_${Math.floor(5e3 * Math.random())}.pdf`,
b =
(t
? ((v = n.data.Signers?.map(e => e.Name + ' <' + e.Email + '>')),
? ((P = n.data.Signers?.map(e => e.Name + ' <' + e.Email + '>')),
(e =
v && 0 < v.length
P && 0 < P.length
? plainAddPlaceholder({
pdfBuffer: e,
reason: 'Digitally signed by Open sign for ' + v?.join(', '),
reason: 'Digitally signed by Open sign for ' + P?.join(', '),
location: 'location',
signatureLength: 1e4,
})
Expand All @@ -237,8 +242,8 @@ async function PDF(i, o) {
location: 'location',
signatureLength: 1e4,
})),
(P = await new SignPDF(e, u).signPDF()),
fs.writeFileSync(x, P))
(v = await new SignPDF(e, u).signPDF()),
fs.writeFileSync(x, v))
: fs.writeFileSync(x, e),
await uploadFile(x));
if (b && b.imageUrl) {
Expand All @@ -265,7 +270,7 @@ async function PDF(i, o) {
pdfName: n.data.Name,
receiver: n.data.ExtUserPtr.Email,
}),
sendDoctoWebhook(n)),
sendDoctoWebhook(n, b.imageUrl)),
fs.unlinkSync(x),
console.log('New Signed PDF created called: ' + x),
'success' === o.message
Expand Down