feat: Trash (#1082)

* wip: trash

* Enable restoration of deleted documents

* update Trash icon

* Add endpoint to trigger garbage collection

* fix: account for drafts

* fix: Archived documents should be deletable

* fix: Missing delete cascade

* bump: upgrade rich-markdown-editor
This commit is contained in:
Tom Moor
2019-11-18 18:51:32 -08:00
committed by GitHub
parent 14f6e6abad
commit e404955394
20 changed files with 346 additions and 30 deletions

View File

@@ -400,10 +400,25 @@ class DocumentScene extends React.Component<Props> {
/>
)}
<MaxWidth archived={document.isArchived} column auto>
{document.archivedAt && (
{document.archivedAt &&
!document.deletedAt && (
<Notice muted>
Archived by {document.updatedBy.name}{' '}
<Time dateTime={document.archivedAt} /> ago
</Notice>
)}
{document.deletedAt && (
<Notice muted>
Archived by {document.updatedBy.name}{' '}
<Time dateTime={document.archivedAt} /> ago
Deleted by {document.updatedBy.name}{' '}
<Time dateTime={document.deletedAt} /> ago
{document.permanentlyDeletedAt && (
<React.Fragment>
<br />
This document will be permanently deleted in{' '}
<Time dateTime={document.permanentlyDeletedAt} /> unless
restored.
</React.Fragment>
)}
</Notice>
)}
<Editor