[PR #712] [CLOSED] feat: allow deletion of any document #1130

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

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/712
Author: @bilalqv
Created: 12/2/2023
Status: Closed

Base: mainHead: feat/doc-373-allow-deletion-of-document


📝 Commits (8)

  • 7678360 feat: allow deletion of any document
  • 6d7f7da feat: do not allow receiver to sign deleted documents
  • 256364d fix: changed dialog component to server component
  • 6edba97 fix: don not send delete email for draft documents
  • 48c20df fix: added single delete dialog, added single delete function
  • dc34b64 fix: removed unnecessary variable declarations
  • f74633d fix: updated import path for email components
  • 6289987 fix: changed delete button to destructive

📊 Changes

14 files changed (+431 additions, -13 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx (+10 -11)
apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx (+117 -0)
apps/web/src/app/(signing)/sign/[token]/deleted/page.tsx (+38 -0)
📝 apps/web/src/app/(signing)/sign/[token]/page.tsx (+4 -0)
packages/email/template-components/template-document-deleted.tsx (+52 -0)
packages/email/templates/document-deleted.tsx (+64 -0)
packages/lib/server-only/document/delete-document.ts (+27 -0)
📝 packages/lib/server-only/document/find-documents.ts (+15 -2)
📝 packages/lib/server-only/document/get-stats.ts (+2 -0)
packages/lib/server-only/document/send-delete-email.ts (+71 -0)
packages/prisma/migrations/20231201124813_add_deleted_at_column_to_document_table/migration.sql (+2 -0)
📝 packages/prisma/schema.prisma (+1 -0)
📝 packages/trpc/server/document-router/router.ts (+21 -0)
📝 packages/trpc/server/document-router/schema.ts (+7 -0)

📄 Description

fixes #696

What features I have implemented:

  • Sender can delete the Draft documents as per current flow (No change here).
  • For Pending / Completed we update the deletedAt column in the Documents table.
  • Sender can delete any pending document. In this case, if the receiver has not signed yet, he will receive an email regarding the document deletion. Even If the receiver opens the sign document link, he will not be able to sign. He will be shown the message that the doc has been deleted by sender. This document is also removed from the receiver documents table /documents.
  • Sender can delete any Completed document but the document still remains in the documents table of the receiver who has already signed it.

If anything is missing, do let me know.


🔄 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/712 **Author:** [@bilalqv](https://github.com/bilalqv) **Created:** 12/2/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/doc-373-allow-deletion-of-document` --- ### 📝 Commits (8) - [`7678360`](https://github.com/documenso/documenso/commit/76783609dd5cc6a0dca14d69b8d1e79912e32512) feat: allow deletion of any document - [`6d7f7da`](https://github.com/documenso/documenso/commit/6d7f7da84ba372e522ed5279bfe769a91f43b19c) feat: do not allow receiver to sign deleted documents - [`256364d`](https://github.com/documenso/documenso/commit/256364d0cb7c36a12f4889128e1f5c7145291f98) fix: changed dialog component to server component - [`6edba97`](https://github.com/documenso/documenso/commit/6edba9750ba2097185017cc8c2778eb3614b2e13) fix: don not send delete email for draft documents - [`48c20df`](https://github.com/documenso/documenso/commit/48c20df4f0e69bb5add3a9c03493001413e92bf5) fix: added single delete dialog, added single delete function - [`dc34b64`](https://github.com/documenso/documenso/commit/dc34b641762b0f10ad858358479fe1e449f0be4c) fix: removed unnecessary variable declarations - [`f74633d`](https://github.com/documenso/documenso/commit/f74633d64a87f69550bc067e4efc11bf772910aa) fix: updated import path for email components - [`6289987`](https://github.com/documenso/documenso/commit/62899874f19ac3ef61daec26e4f5f1bbfb5cf161) fix: changed delete button to destructive ### 📊 Changes **14 files changed** (+431 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx` (+10 -11) ➕ `apps/web/src/app/(dashboard)/documents/delete-document-dialog.tsx` (+117 -0) ➕ `apps/web/src/app/(signing)/sign/[token]/deleted/page.tsx` (+38 -0) 📝 `apps/web/src/app/(signing)/sign/[token]/page.tsx` (+4 -0) ➕ `packages/email/template-components/template-document-deleted.tsx` (+52 -0) ➕ `packages/email/templates/document-deleted.tsx` (+64 -0) ➕ `packages/lib/server-only/document/delete-document.ts` (+27 -0) 📝 `packages/lib/server-only/document/find-documents.ts` (+15 -2) 📝 `packages/lib/server-only/document/get-stats.ts` (+2 -0) ➕ `packages/lib/server-only/document/send-delete-email.ts` (+71 -0) ➕ `packages/prisma/migrations/20231201124813_add_deleted_at_column_to_document_table/migration.sql` (+2 -0) 📝 `packages/prisma/schema.prisma` (+1 -0) 📝 `packages/trpc/server/document-router/router.ts` (+21 -0) 📝 `packages/trpc/server/document-router/schema.ts` (+7 -0) </details> ### 📄 Description fixes #696 What features I have implemented: - Sender can delete the Draft documents as per current flow (No change here). - For **Pending** / **Completed** we update the `deletedAt` column in the **Documents** table. - Sender can delete any pending document. In this case, if the receiver has not signed yet, he will receive an email regarding the document deletion. Even If the receiver opens the sign document link, he will not be able to sign. He will be shown the message that the doc has been deleted by sender. This document is also removed from the receiver documents table `/documents`. - Sender can delete any Completed document but the document still remains in the documents table of the receiver who has already signed it. If anything is missing, do let me know. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:31:57 +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#1130
No description provided.