[PR #985] [CLOSED] feat: save document logs as pdf #1298

Closed
opened 2026-02-26 19:32:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/985
Author: @paolo
Created: 3/1/2024
Status: Closed

Base: mainHead: feat/document-audit-logs-pdf


📝 Commits (10+)

  • a19e078 feat: offer download certificate and logs when document is completed
  • 4638021 feat: add addition data field to store document logs and signature certificate
  • 970c569 feat: define the skeleton for getting or generating document logs pdf
  • 6ed4300 feat: initial pdf document implementation
  • 1c31bde feat: trigger document logs generation
  • d82f204 chore: add @react-pdf/renderer into @documenso/lib package
  • 65bea56 chore: add nextjs config as suggested by @react-pdf/renderer
  • b5e6e4f feat: initial document logs pdf with react-pdf
  • 02409b4 feat: call build document logs
  • 5268396 feat: add component to download additional data from a doc

📊 Changes

13 files changed (+1010 additions, -19 deletions)

View changed files

📝 apps/web/next.config.js (+1 -0)
📝 apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-page-view.tsx (+31 -12)
📝 package-lock.json (+386 -1)
📝 packages/lib/client-only/download-pdf.ts (+2 -2)
📝 packages/lib/package.json (+1 -0)
packages/lib/server-only/document/get-or-generate-document-logs.ts (+70 -0)
packages/lib/server-only/pdf/build-document-logs.tsx (+238 -0)
packages/lib/server-only/pdf/generate-document-logs.ts (+143 -0)
📝 packages/lib/universal/upload/put-file.ts (+8 -2)
packages/prisma/migrations/20240229161806_document_additional_data/migration.sql (+19 -0)
📝 packages/prisma/schema.prisma (+19 -1)
📝 packages/prisma/types/document.ts (+21 -1)
packages/ui/components/document/document-additional-data-download-button.tsx (+71 -0)

📄 Description

In order to be CFR P11 compliant, document logs file should be created and stored within Documenso's servers.

This branch is using a similar strategy from the documents themselves to store "additional data", namely, logs and signature certificates (for the time being).

A new table has been created: DocumentAdditionalData, which is similar to DocumentData, thanks to this similarity, I was able to re-use some of the functions implemented to store and read files from the configured storage.

Regarding the PDF creation, @react-pdf/renderer was used to easily shape the document using their provided components. here's a sample of the resulting pdf document.

demo-logs.pdf


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/985 **Author:** [@paolo](https://github.com/paolo) **Created:** 3/1/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/document-audit-logs-pdf` --- ### 📝 Commits (10+) - [`a19e078`](https://github.com/documenso/documenso/commit/a19e078cbec1d3ed6d79ad1fe18c3f1c52878af0) feat: offer download certificate and logs when document is completed - [`4638021`](https://github.com/documenso/documenso/commit/4638021ba3fc4ac46577ce5493f666ac80414c67) feat: add addition data field to store document logs and signature certificate - [`970c569`](https://github.com/documenso/documenso/commit/970c569f6091c47208d6652064719a47e488304c) feat: define the skeleton for getting or generating document logs pdf - [`6ed4300`](https://github.com/documenso/documenso/commit/6ed4300bb39c0b549952bb8471f3b7208914e0b0) feat: initial pdf document implementation - [`1c31bde`](https://github.com/documenso/documenso/commit/1c31bded0291601f94fc3f0be136672a33e47af6) feat: trigger document logs generation - [`d82f204`](https://github.com/documenso/documenso/commit/d82f204ae59730f94a6e5796bae0ffc098760783) chore: add @react-pdf/renderer into @documenso/lib package - [`65bea56`](https://github.com/documenso/documenso/commit/65bea56db31d6eb73b6d8a5c5390ddca5915fe34) chore: add nextjs config as suggested by @react-pdf/renderer - [`b5e6e4f`](https://github.com/documenso/documenso/commit/b5e6e4fb69e9d72655edaf2f1d5cb94189684c90) feat: initial document logs pdf with react-pdf - [`02409b4`](https://github.com/documenso/documenso/commit/02409b4c829ffebd587720fc6dcdf661f661bd2c) feat: call build document logs - [`5268396`](https://github.com/documenso/documenso/commit/526839647d0e6770ede110ff5229593f127cc829) feat: add component to download additional data from a doc ### 📊 Changes **13 files changed** (+1010 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/next.config.js` (+1 -0) 📝 `apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-page-view.tsx` (+31 -12) 📝 `package-lock.json` (+386 -1) 📝 `packages/lib/client-only/download-pdf.ts` (+2 -2) 📝 `packages/lib/package.json` (+1 -0) ➕ `packages/lib/server-only/document/get-or-generate-document-logs.ts` (+70 -0) ➕ `packages/lib/server-only/pdf/build-document-logs.tsx` (+238 -0) ➕ `packages/lib/server-only/pdf/generate-document-logs.ts` (+143 -0) 📝 `packages/lib/universal/upload/put-file.ts` (+8 -2) ➕ `packages/prisma/migrations/20240229161806_document_additional_data/migration.sql` (+19 -0) 📝 `packages/prisma/schema.prisma` (+19 -1) 📝 `packages/prisma/types/document.ts` (+21 -1) ➕ `packages/ui/components/document/document-additional-data-download-button.tsx` (+71 -0) </details> ### 📄 Description In order to be CFR P11 compliant, document logs file should be created and stored within Documenso's servers. This branch is using a similar strategy from the documents themselves to store "additional data", namely, logs and signature certificates (for the time being). A new table has been created: `DocumentAdditionalData`, which is similar to `DocumentData`, thanks to this similarity, I was able to re-use some of the functions implemented to store and read files from the configured storage. Regarding the PDF creation, `@react-pdf/renderer` was used to easily shape the document using their provided components. here's a sample of the resulting pdf document. [demo-logs.pdf](https://github.com/documenso/documenso/files/14464750/demo-logs.pdf) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:32:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1298
No description provided.