mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
fix: cleanup
This commit is contained in:
@ -70,6 +70,7 @@ export async function loader({ request }: Route.LoaderArgs) {
|
|||||||
id: mapSecondaryIdToDocumentId(envelope.secondaryId),
|
id: mapSecondaryIdToDocumentId(envelope.secondaryId),
|
||||||
title: envelope.title,
|
title: envelope.title,
|
||||||
status: envelope.status,
|
status: envelope.status,
|
||||||
|
envelopeId: envelope.id,
|
||||||
user: {
|
user: {
|
||||||
name: envelope.user.name,
|
name: envelope.user.name,
|
||||||
email: envelope.user.email,
|
email: envelope.user.email,
|
||||||
@ -109,10 +110,9 @@ export default function AuditLog({ loaderData }: Route.ComponentProps) {
|
|||||||
<Card>
|
<Card>
|
||||||
<CardContent className="grid grid-cols-2 gap-4 p-6 text-sm print:text-xs">
|
<CardContent className="grid grid-cols-2 gap-4 p-6 text-sm print:text-xs">
|
||||||
<p>
|
<p>
|
||||||
{/* Todo: Envelopes - [PRE-MAIN] Should we should envelope ID instead here? */}
|
<span className="font-medium">{_(msg`Envelope ID`)}</span>
|
||||||
<span className="font-medium">{_(msg`Document ID`)}</span>
|
|
||||||
|
|
||||||
<span className="mt-1 block break-words">{document.id}</span>
|
<span className="mt-1 block break-words">{document.envelopeId}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@ -775,7 +775,7 @@ export const ApiContractV1Implementation = tsr.router(ApiContractV1, {
|
|||||||
name: recipient.name,
|
name: recipient.name,
|
||||||
email: recipient.email,
|
email: recipient.email,
|
||||||
signingOrder: recipient.signingOrder,
|
signingOrder: recipient.signingOrder,
|
||||||
role: recipient.role, // Todo: Migration - Should you actually be able to change the role???
|
role: recipient.role, // You probably shouldn't be able to change the role.
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -99,19 +99,13 @@ export const run = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// This is the same case as above.
|
// This is the same case as above.
|
||||||
let envelopeItems: typeof envelope.envelopeItems = await io.runTask(
|
let envelopeItems = await io.runTask(
|
||||||
'get-document-data-id', // Todo: Envelopes [PRE-MAIN] - Fix these messed up types.
|
'get-document-data-id',
|
||||||
// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
async (): Promise<any> => {
|
async () => {
|
||||||
return envelope.envelopeItems.map((envelopeItem) => ({
|
// eslint-disable-next-line unused-imports/no-unused-vars
|
||||||
...envelopeItem,
|
return envelope.envelopeItems.map(({ field, ...rest }) => ({
|
||||||
fields: envelopeItem.field.map((field) => ({
|
...rest,
|
||||||
...field,
|
|
||||||
positionX: Number(field.positionX),
|
|
||||||
positionY: Number(field.positionY),
|
|
||||||
width: Number(field.width),
|
|
||||||
height: Number(field.height),
|
|
||||||
})),
|
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -186,16 +180,25 @@ export const run = async ({
|
|||||||
|
|
||||||
const newDocumentData = await Promise.all(
|
const newDocumentData = await Promise.all(
|
||||||
envelopeItems.map(async (envelopeItem) =>
|
envelopeItems.map(async (envelopeItem) =>
|
||||||
io.runTask('decorate-and-sign-pdf', async () =>
|
io.runTask('decorate-and-sign-pdf', async () => {
|
||||||
decorateAndSignPdf({
|
const envelopeItemFields = envelope.envelopeItems.find(
|
||||||
|
(item) => item.id === envelopeItem.id,
|
||||||
|
)?.field;
|
||||||
|
|
||||||
|
if (!envelopeItemFields) {
|
||||||
|
throw new Error(`Envelope item fields not found for envelope item ${envelopeItem.id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return decorateAndSignPdf({
|
||||||
envelope,
|
envelope,
|
||||||
envelopeItem,
|
envelopeItem,
|
||||||
|
envelopeItemFields,
|
||||||
isRejected,
|
isRejected,
|
||||||
rejectionReason,
|
rejectionReason,
|
||||||
certificateData,
|
certificateData,
|
||||||
auditLogData,
|
auditLogData,
|
||||||
}),
|
});
|
||||||
),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -293,7 +296,8 @@ export const run = async ({
|
|||||||
|
|
||||||
type DecorateAndSignPdfOptions = {
|
type DecorateAndSignPdfOptions = {
|
||||||
envelope: Pick<Envelope, 'id' | 'title' | 'useLegacyFieldInsertion' | 'internalVersion'>;
|
envelope: Pick<Envelope, 'id' | 'title' | 'useLegacyFieldInsertion' | 'internalVersion'>;
|
||||||
envelopeItem: EnvelopeItem & { documentData: DocumentData; field: Field[] };
|
envelopeItem: EnvelopeItem & { documentData: DocumentData };
|
||||||
|
envelopeItemFields: Field[];
|
||||||
isRejected: boolean;
|
isRejected: boolean;
|
||||||
rejectionReason: string;
|
rejectionReason: string;
|
||||||
certificateData: Buffer | null;
|
certificateData: Buffer | null;
|
||||||
@ -306,6 +310,7 @@ type DecorateAndSignPdfOptions = {
|
|||||||
const decorateAndSignPdf = async ({
|
const decorateAndSignPdf = async ({
|
||||||
envelope,
|
envelope,
|
||||||
envelopeItem,
|
envelopeItem,
|
||||||
|
envelopeItemFields,
|
||||||
isRejected,
|
isRejected,
|
||||||
rejectionReason,
|
rejectionReason,
|
||||||
certificateData,
|
certificateData,
|
||||||
@ -348,7 +353,7 @@ const decorateAndSignPdf = async ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const field of envelopeItem.field) {
|
for (const field of envelopeItemFields) {
|
||||||
if (field.inserted) {
|
if (field.inserted) {
|
||||||
if (envelope.internalVersion === 2) {
|
if (envelope.internalVersion === 2) {
|
||||||
await insertFieldInPDFV2(pdfDoc, field);
|
await insertFieldInPDFV2(pdfDoc, field);
|
||||||
|
|||||||
@ -257,7 +257,6 @@ const injectFormValuesIntoDocument = async (
|
|||||||
id: envelopeItem.id,
|
id: envelopeItem.id,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
// Todo: Envelopes [PRE-MAIN] - Should this also replace the initial data? Because if it's resealed we use the initial data thus lose the form values.
|
|
||||||
documentDataId: newDocumentData.id,
|
documentDataId: newDocumentData.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export const createEnvelopeFields = async ({
|
|||||||
// The item to attach the fields to MUST belong to the document.
|
// The item to attach the fields to MUST belong to the document.
|
||||||
if (
|
if (
|
||||||
field.envelopeItemId &&
|
field.envelopeItemId &&
|
||||||
!envelope.envelopeItems.find((envelopeItem) => envelopeItem.id === field.envelopeItemId) // Todo: Migration test this
|
!envelope.envelopeItems.find((envelopeItem) => envelopeItem.id === field.envelopeItemId)
|
||||||
) {
|
) {
|
||||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||||
message: 'Item to attach fields to must belong to the document',
|
message: 'Item to attach fields to must belong to the document',
|
||||||
|
|||||||
@ -395,7 +395,6 @@ export const createDocumentFromTemplate = async ({
|
|||||||
const oldEnvelopeItemToNewEnvelopeItemIdMap: Record<string, string> = {};
|
const oldEnvelopeItemToNewEnvelopeItemIdMap: Record<string, string> = {};
|
||||||
|
|
||||||
// Duplicate the envelope item data.
|
// Duplicate the envelope item data.
|
||||||
// Todo: Envelopes - Ask if it's okay to just use the documentDataId? Or should it be duplicated?
|
|
||||||
// Note: This is duplicated in createDocumentFromDirectTemplate
|
// Note: This is duplicated in createDocumentFromDirectTemplate
|
||||||
const envelopeItemsToCreate = await Promise.all(
|
const envelopeItemsToCreate = await Promise.all(
|
||||||
template.envelopeItems.map(async (item, i) => {
|
template.envelopeItems.map(async (item, i) => {
|
||||||
@ -424,9 +423,6 @@ export const createDocumentFromTemplate = async ({
|
|||||||
|
|
||||||
const buffer = await getFileServerSide(documentDataToDuplicate);
|
const buffer = await getFileServerSide(documentDataToDuplicate);
|
||||||
|
|
||||||
// Todo: Envelopes [PRE-MAIN] - Should we normalize? Should be part of the upload.
|
|
||||||
// const normalizedPdf = await makeNormalizedPdf(Buffer.from(buffer));
|
|
||||||
|
|
||||||
const titleToUse = item.title || finalEnvelopeTitle;
|
const titleToUse = item.title || finalEnvelopeTitle;
|
||||||
|
|
||||||
const duplicatedFile = await putPdfFileServerSide({
|
const duplicatedFile = await putPdfFileServerSide({
|
||||||
|
|||||||
@ -3301,7 +3301,6 @@ msgstr ""
|
|||||||
msgid "Document found in your account"
|
msgid "Document found in your account"
|
||||||
msgstr "Dokument in Ihrem Konto gefunden"
|
msgstr "Dokument in Ihrem Konto gefunden"
|
||||||
|
|
||||||
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
|
||||||
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
||||||
msgid "Document ID"
|
msgid "Document ID"
|
||||||
msgstr "Dokument-ID"
|
msgstr "Dokument-ID"
|
||||||
@ -3962,6 +3961,10 @@ msgstr ""
|
|||||||
msgid "Envelope Duplicated"
|
msgid "Envelope Duplicated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
||||||
|
msgid "Envelope ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
||||||
msgid "Envelope resent"
|
msgid "Envelope resent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@ -3296,7 +3296,6 @@ msgstr "Document external ID updated"
|
|||||||
msgid "Document found in your account"
|
msgid "Document found in your account"
|
||||||
msgstr "Document found in your account"
|
msgstr "Document found in your account"
|
||||||
|
|
||||||
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
|
||||||
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
||||||
msgid "Document ID"
|
msgid "Document ID"
|
||||||
msgstr "Document ID"
|
msgstr "Document ID"
|
||||||
@ -3957,6 +3956,10 @@ msgstr "Envelope distributed"
|
|||||||
msgid "Envelope Duplicated"
|
msgid "Envelope Duplicated"
|
||||||
msgstr "Envelope Duplicated"
|
msgstr "Envelope Duplicated"
|
||||||
|
|
||||||
|
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
||||||
|
msgid "Envelope ID"
|
||||||
|
msgstr "Envelope ID"
|
||||||
|
|
||||||
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
||||||
msgid "Envelope resent"
|
msgid "Envelope resent"
|
||||||
msgstr "Envelope resent"
|
msgstr "Envelope resent"
|
||||||
|
|||||||
@ -3301,7 +3301,6 @@ msgstr ""
|
|||||||
msgid "Document found in your account"
|
msgid "Document found in your account"
|
||||||
msgstr "Documento encontrado en tu cuenta"
|
msgstr "Documento encontrado en tu cuenta"
|
||||||
|
|
||||||
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
|
||||||
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
||||||
msgid "Document ID"
|
msgid "Document ID"
|
||||||
msgstr "ID del documento"
|
msgstr "ID del documento"
|
||||||
@ -3962,6 +3961,10 @@ msgstr ""
|
|||||||
msgid "Envelope Duplicated"
|
msgid "Envelope Duplicated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
||||||
|
msgid "Envelope ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
||||||
msgid "Envelope resent"
|
msgid "Envelope resent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@ -3301,7 +3301,6 @@ msgstr ""
|
|||||||
msgid "Document found in your account"
|
msgid "Document found in your account"
|
||||||
msgstr "Document trouvé dans votre compte"
|
msgstr "Document trouvé dans votre compte"
|
||||||
|
|
||||||
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
|
||||||
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
||||||
msgid "Document ID"
|
msgid "Document ID"
|
||||||
msgstr "ID du document"
|
msgstr "ID du document"
|
||||||
@ -3962,6 +3961,10 @@ msgstr ""
|
|||||||
msgid "Envelope Duplicated"
|
msgid "Envelope Duplicated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
||||||
|
msgid "Envelope ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
||||||
msgid "Envelope resent"
|
msgid "Envelope resent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@ -3301,7 +3301,6 @@ msgstr ""
|
|||||||
msgid "Document found in your account"
|
msgid "Document found in your account"
|
||||||
msgstr "Documento trovato nel tuo account"
|
msgstr "Documento trovato nel tuo account"
|
||||||
|
|
||||||
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
|
||||||
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
||||||
msgid "Document ID"
|
msgid "Document ID"
|
||||||
msgstr "ID del documento"
|
msgstr "ID del documento"
|
||||||
@ -3962,6 +3961,10 @@ msgstr ""
|
|||||||
msgid "Envelope Duplicated"
|
msgid "Envelope Duplicated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
||||||
|
msgid "Envelope ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
||||||
msgid "Envelope resent"
|
msgid "Envelope resent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@ -3301,7 +3301,6 @@ msgstr ""
|
|||||||
msgid "Document found in your account"
|
msgid "Document found in your account"
|
||||||
msgstr "Dokument znaleziony na Twoim koncie"
|
msgstr "Dokument znaleziony na Twoim koncie"
|
||||||
|
|
||||||
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
|
||||||
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
#: apps/remix/app/routes/_authenticated+/t.$teamUrl+/documents.$id.logs.tsx
|
||||||
msgid "Document ID"
|
msgid "Document ID"
|
||||||
msgstr "Identyfikator dokumentu"
|
msgstr "Identyfikator dokumentu"
|
||||||
@ -3962,6 +3961,10 @@ msgstr ""
|
|||||||
msgid "Envelope Duplicated"
|
msgid "Envelope Duplicated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: apps/remix/app/routes/_internal+/[__htmltopdf]+/audit-log.tsx
|
||||||
|
msgid "Envelope ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
#: apps/remix/app/components/dialogs/envelope-redistribute-dialog.tsx
|
||||||
msgid "Envelope resent"
|
msgid "Envelope resent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
Reference in New Issue
Block a user