8000 feat: deleted documents bin by ephraimduncan · Pull Request #1705 · documenso/documenso · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: deleted documents bin #1705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat: deleted documents bin #1705

wants to merge 4 commits into from

Conversation

ephraimduncan
Copy link
Contributor

No description provided.

Copy link
vercel bot commented Mar 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stg-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2025 2:33pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
prd-app ⬜️ Ignored (Inspect) May 1, 2025 2:33pm
prd-docs ⬜️ Ignored (Inspect) Visit Preview May 1, 2025 2:33pm
stg-app ⬜️ Ignored (Inspect) May 1, 2025 2:33pm
prd-openpage-api ⬜️ Skipped (Inspect) May 1, 2025 2:33pm

Copy link
Contributor
coderabbitai bot commented Mar 13, 2025

Important

Review skipped

Auto reviews are limited to specific labels.

🏷️ Labels to auto review (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited 8000 context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

🚨 @ephraimduncan has 12 pull requests awaiting review. Please consider reviewing them when possible. 🚨

Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new "DELETED" document status along with functionality to restore deleted documents, updating various schemas, routers, queries, and UI components accordingly.

  • Added a new extended document status "DELETED" in the Prisma types.
  • Implemented restore document endpoints, mutation schemas, and audit logging.
  • Updated document queries, stats, and UI components to support handling deleted documents.

Reviewed Changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/trpc/server/document-router/schema.ts Added schema for the restore document mutation and updated document counting.
packages/trpc/server/document-router/router.ts Introduced a restoreDocument mutation endpoint.
packages/prisma/types/extended-document-status.ts Added the DELETED status to the document status enum.
packages/lib/types/document-audit-logs.ts Added audit log handling for document restoration.
packages/lib/server-only/document/restore-document.ts Implemented the restoreDocument function with transaction and webhook trigger.
packages/lib/server-only/document/get-stats.ts Updated document statistics queries to count DELETED documents.
packages/lib/server-only/document/find-documents.ts Modified document filtering to include a new deleted date range logic for DELETED documents.
packages/lib/server-only/admin/get-documents-stats.ts Updated admin stats to include the DELETED status.
apps/remix/app/routes/_authenticated+/documents._index.tsx Updated document tabs to include the DELETED status.
apps/remix/app/components/tables/documents-table.tsx Adjusted table actions to handle deleted documents.
apps/remix/app/components/tables/documents-table-empty-state.tsx Added an empty state for DELETED documents using the Trash icon.
apps/remix/app/components/tables/documents-table-action-dropdown.tsx Updated dropdown actions to include restoration of deleted documents.
apps/remix/app/components/general/document/document-status.tsx Updated document status display with a new DELETED state.
apps/remix/app/components/general/document/document-page-view-information.tsx Show deletion date information when applicable.
apps/remix/app/components/general/document-signing/document-signing-recipient-provider.tsx Removed commented logs; no functional change.
apps/remix/app/components/dialogs/document-restore-dialog.tsx Added dialog UI for restoring deleted documents.
apps/remix/app/components/dialogs/document-delete-dialog.tsx Updated fallback messaging in delete dialog for clarity.
Files not reviewed (2)
  • packages/prisma/migrations/20250313201939_add_document_restored_webhook_event/migration.sql: Language not supported
  • packages/prisma/schema.prisma: Language not supported

@vercel vercel bot temporarily deployed to Preview – prd-openpage-api May 1, 2025 14:29 Inactive
@ephraimduncan ephraimduncan requested a review from Copilot May 1, 2025 14:30
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a deleted documents bin feature that supports restoring deleted documents and includes the new DELETED status across the application. Key changes include:

  • Adding a new restore endpoint and dialog to re-enable deleted documents.
  • Updating stats, filters, and UI components to support and display the deleted documents status.
  • Enhancing document history and status mapping to reflect the DELETED state.

Reviewed Changes

Copilot reviewed 21 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/lib/server-only/document/restore-document.ts Adds restore functionality for deleted documents
packages/lib/server-only/document/get-stats.ts Updates statistics query to include deleted documents count
packages/lib/server-only/document/find-documents.ts Introduces filtering logic for deleted documents
packages/lib/server-only/admin/get-documents-stats.ts Includes a new count for deleted documents
apps/remix/app/routes/_authenticated+/documents._index.tsx Updates tab navigation to include a deleted documents view
apps/remix/app/components/tables/documents-table.ts Modifies the actions column rendering logic
apps/remix/app/components/tables/documents-table-empty-state.tsx Adds empty state message for the trash
apps/remix/app/components/tables/documents-table-action-dropdown.tsx Adds restoration action and dialog for deleted documents
apps/remix/app/components/general/document/document-status.tsx Updates friendly status mapping with DELETED and REJECTED statuses
apps/remix/app/components/general/document/page-view-information.tsx Appends deletion date info in document details
apps/remix/app/components/general/document-history-sheet.tsx Tracks document restore actions in history logs
apps/remix/app/components/dialogs/document-restore-dialog.tsx Implements dialog UI for restoring deleted documents
Files not reviewed (6)
  • packages/lib/translations/de/web.po: Language not supported
  • packages/lib/translations/en/web.po: Language not supported
  • packages/lib/translations/es/web.po: Language not supported
  • packages/lib/translations/fr/web.po: Language not supported
  • packages/lib/translations/it/web.po: Language not supported
  • packages/lib/translations/pl/web.po: Language not supported
Comments suppressed due to low confidence (1)

apps/remix/app/components/general/document/document-status.tsx:36

  • [nitpick] The mapping now includes a DELETED entry immediately before reintroducing REJECTED further down, which may confuse maintainers. Consider aligning the order of statuses to reflect a logical progression or grouping for clarity.
export const FRIENDLY_STATUS_MAP: Record<ExtendedDocumentStatus, FriendlyStatus> = {

<DocumentsTableActionDropdown row={row.original} />
</div>
),
cell: ({ row }) => (
Copy link
Preview
Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional check that previously prevented rendering action buttons for deleted documents has been removed. Please confirm that the actions should now be visible regardless of the deletion status or add an appropriate guard to maintain intended behavior.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0