diff --git a/apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx b/apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
index a324bcf13..6be4f0a90 100644
--- a/apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+++ b/apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
@@ -43,6 +43,7 @@ export const DocumentSigningAttachmentsDialog = ({
No attachments available.
)}
+
{attachments.map((attachment, idx) => (
[];
+ user: Pick;
+ requestMetadata: RequestMetadata;
};
export const setDocumentAttachments = async ({
documentId,
attachments,
+ user,
+ requestMetadata,
}: CreateAttachmentsOptions) => {
const document = await prisma.document.findUnique({
where: {
@@ -75,5 +82,29 @@ export const setDocumentAttachments = async ({
}
}
+ const isAttachmentsSame = upsertedAttachments.every((attachment) => {
+ const existingAttachment = existingAttachments.find((a) => a.id === attachment.id);
+ return (
+ existingAttachment?.label === attachment.label &&
+ existingAttachment?.url === attachment.url &&
+ existingAttachment?.type === attachment.type
+ );
+ });
+
+ if (!isAttachmentsSame) {
+ await prisma.documentAuditLog.create({
+ data: createDocumentAuditLogData({
+ type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_ATTACHMENTS_UPDATED,
+ documentId: document.id,
+ user,
+ data: {
+ from: existingAttachments,
+ to: upsertedAttachments,
+ },
+ requestMetadata,
+ }),
+ });
+ }
+
return upsertedAttachments;
};
diff --git a/packages/lib/translations/de/web.po b/packages/lib/translations/de/web.po
index 18b127727..f747a7fbb 100644
--- a/packages/lib/translations/de/web.po
+++ b/packages/lib/translations/de/web.po
@@ -1435,7 +1435,8 @@ msgstr "Unterstützend"
msgid "At least one signature type must be enabled"
msgstr "Mindestens ein Signaturtyp muss aktiviert sein"
-#: apps/remix/app/components/general/document-signing/document-signing-form.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
msgid "Attachments"
msgstr ""
@@ -4414,6 +4415,10 @@ msgstr "Nein"
msgid "No active drafts"
msgstr "Keine aktiven Entwürfe"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "No attachments available."
+msgstr ""
+
#: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx
#: apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx
msgid "No folders found"
@@ -7651,6 +7656,10 @@ msgstr "Betrachten"
msgid "View activity"
msgstr "Aktivität ansehen"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "View all attachments for this document."
+msgstr ""
+
#: packages/email/templates/confirm-team-email.tsx
msgid "View all documents sent to and from this email address"
msgstr "Sehen Sie sich alle Dokumente an, die an diese E-Mail-Adresse gesendet wurden und von dieser E-Mail-Adresse gesendet wurden"
diff --git a/packages/lib/translations/en/web.po b/packages/lib/translations/en/web.po
index 01a0eed30..6c14cd193 100644
--- a/packages/lib/translations/en/web.po
+++ b/packages/lib/translations/en/web.po
@@ -1430,7 +1430,8 @@ msgstr "Assisting"
msgid "At least one signature type must be enabled"
msgstr "At least one signature type must be enabled"
-#: apps/remix/app/components/general/document-signing/document-signing-form.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
msgid "Attachments"
msgstr "Attachments"
@@ -4409,6 +4410,10 @@ msgstr "No"
msgid "No active drafts"
msgstr "No active drafts"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "No attachments available."
+msgstr "No attachments available."
+
#: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx
#: apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx
msgid "No folders found"
@@ -7658,6 +7663,10 @@ msgstr "View"
msgid "View activity"
msgstr "View activity"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "View all attachments for this document."
+msgstr "View all attachments for this document."
+
#: packages/email/templates/confirm-team-email.tsx
msgid "View all documents sent to and from this email address"
msgstr "View all documents sent to and from this email address"
diff --git a/packages/lib/translations/es/web.po b/packages/lib/translations/es/web.po
index 6f86ace66..b18d8754d 100644
--- a/packages/lib/translations/es/web.po
+++ b/packages/lib/translations/es/web.po
@@ -1435,7 +1435,8 @@ msgstr "Asistiendo"
msgid "At least one signature type must be enabled"
msgstr "Al menos un tipo de firma debe estar habilitado"
-#: apps/remix/app/components/general/document-signing/document-signing-form.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
msgid "Attachments"
msgstr ""
@@ -4414,6 +4415,10 @@ msgstr "No"
msgid "No active drafts"
msgstr "No hay borradores activos"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "No attachments available."
+msgstr ""
+
#: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx
#: apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx
msgid "No folders found"
@@ -7653,6 +7658,10 @@ msgstr "Ver"
msgid "View activity"
msgstr "Ver actividad"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "View all attachments for this document."
+msgstr ""
+
#: packages/email/templates/confirm-team-email.tsx
msgid "View all documents sent to and from this email address"
msgstr "Ver todos los documentos enviados hacia y desde esta dirección de correo electrónico"
diff --git a/packages/lib/translations/fr/web.po b/packages/lib/translations/fr/web.po
index 6db3b47ed..f29ce40b1 100644
--- a/packages/lib/translations/fr/web.po
+++ b/packages/lib/translations/fr/web.po
@@ -1435,7 +1435,8 @@ msgstr "En assistance"
msgid "At least one signature type must be enabled"
msgstr "Au moins un type de signature doit être activé"
-#: apps/remix/app/components/general/document-signing/document-signing-form.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
msgid "Attachments"
msgstr ""
@@ -4414,6 +4415,10 @@ msgstr "Non"
msgid "No active drafts"
msgstr "Pas de brouillons actifs"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "No attachments available."
+msgstr ""
+
#: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx
#: apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx
msgid "No folders found"
@@ -7651,6 +7656,10 @@ msgstr "Voir"
msgid "View activity"
msgstr "Voir l'activité"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "View all attachments for this document."
+msgstr ""
+
#: packages/email/templates/confirm-team-email.tsx
msgid "View all documents sent to and from this email address"
msgstr "Voir tous les documents envoyés à et depuis cette adresse e-mail"
diff --git a/packages/lib/translations/it/web.po b/packages/lib/translations/it/web.po
index f78b1c798..7d2f11de5 100644
--- a/packages/lib/translations/it/web.po
+++ b/packages/lib/translations/it/web.po
@@ -1435,7 +1435,8 @@ msgstr "Assistenza in corso"
msgid "At least one signature type must be enabled"
msgstr "Deve essere abilitato almeno un tipo di firma"
-#: apps/remix/app/components/general/document-signing/document-signing-form.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
msgid "Attachments"
msgstr ""
@@ -4414,6 +4415,10 @@ msgstr "No"
msgid "No active drafts"
msgstr "Nessuna bozza attiva"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "No attachments available."
+msgstr ""
+
#: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx
#: apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx
msgid "No folders found"
@@ -7663,6 +7668,10 @@ msgstr "Visualizza"
msgid "View activity"
msgstr "Visualizza attività"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "View all attachments for this document."
+msgstr ""
+
#: packages/email/templates/confirm-team-email.tsx
msgid "View all documents sent to and from this email address"
msgstr "Visualizza tutti i documenti inviati a o da questo indirizzo email"
diff --git a/packages/lib/translations/pl/web.po b/packages/lib/translations/pl/web.po
index 81c3a7a33..0e09b16c5 100644
--- a/packages/lib/translations/pl/web.po
+++ b/packages/lib/translations/pl/web.po
@@ -1435,7 +1435,8 @@ msgstr "Asystowanie"
msgid "At least one signature type must be enabled"
msgstr "Przynajmniej jeden typ podpisu musi być włączony"
-#: apps/remix/app/components/general/document-signing/document-signing-form.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
msgid "Attachments"
msgstr ""
@@ -4414,6 +4415,10 @@ msgstr "Nie"
msgid "No active drafts"
msgstr "Brak aktywnych szkiców"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "No attachments available."
+msgstr ""
+
#: apps/remix/app/components/dialogs/template-move-to-folder-dialog.tsx
#: apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx
msgid "No folders found"
@@ -7651,6 +7656,10 @@ msgstr "Widok"
msgid "View activity"
msgstr "Wyświetl aktywność"
+#: apps/remix/app/components/general/document-signing/document-signing-attachments-dialog.tsx
+msgid "View all attachments for this document."
+msgstr ""
+
#: packages/email/templates/confirm-team-email.tsx
msgid "View all documents sent to and from this email address"
msgstr "Wyświetl wszystkie dokumenty wysłane do i z tego adresu e-mail"
diff --git a/packages/trpc/server/attachment-router/router.ts b/packages/trpc/server/attachment-router/router.ts
index 244f05e74..b7698563f 100644
--- a/packages/trpc/server/attachment-router/router.ts
+++ b/packages/trpc/server/attachment-router/router.ts
@@ -46,6 +46,8 @@ export const attachmentRouter = router({
const updatedAttachments = await setDocumentAttachments({
documentId,
attachments,
+ user: ctx.user,
+ requestMetadata: ctx.metadata.requestMetadata,
});
return updatedAttachments;