docmost icon indicating copy to clipboard operation
docmost copied to clipboard

feat: Recycle bin for deleted pages in space

Open mobley-trent opened this issue 1 year ago • 17 comments

Closes #59

mobley-trent avatar Sep 18 '24 08:09 mobley-trent

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 18 '24 08:09 CLAassistant

POC

https://github.com/user-attachments/assets/e5668ef1-5b44-408b-86a3-43b09bb84d27

mobley-trent avatar Sep 24 '24 11:09 mobley-trent

@Philipinho kindly review

mobley-trent avatar Sep 24 '24 11:09 mobley-trent

I can’t seem to find how pages with children are handled. Ideally, when a page is soft-deleted, its children should be too. Same applies to restoration.

Let me know if I am missing something.

Philipinho avatar Sep 26 '24 15:09 Philipinho

I can’t seem to find how pages with children are handled. Ideally, when a page is soft-deleted, its children should be too. Same applies to restoration.

Let me know if I am missing something.

Deletion and restoration works with pages that have subpages as well.

mobley-trent avatar Sep 27 '24 06:09 mobley-trent

https://github.com/user-attachments/assets/89b847e5-a0c6-4400-b72d-0015aa9914c9

mobley-trent avatar Sep 27 '24 06:09 mobley-trent

Aside from removing it from the tree, do sub-pages get soft-deleted too? i.e deleted_at field updated for each sub-page.

Philipinho avatar Sep 27 '24 12:09 Philipinho

Aside from removing it from the tree, do sub-pages get soft-deleted too? i.e deleted_at field updated for each sub-page.

I assumed the previous route for page deletion would also handle deletion of subpages, since the route seemed to carry out deletion for a single page. I simply updated the route to update the deletedAt field.

mobley-trent avatar Sep 27 '24 13:09 mobley-trent

The default deletion process auto deletes child pages via foreign key relationship.

Philipinho avatar Sep 27 '24 17:09 Philipinho

@Philipinho I updated the remove (soft delete) and restore routes to fetch page ids for descendants as well.

mobley-trent avatar Sep 30 '24 18:09 mobley-trent

Hi @Philipinho I would appreciate your feedback

mobley-trent avatar Oct 11 '24 10:10 mobley-trent

@mobley-trent thank you for your work. I will get to it.

Philipinho avatar Oct 17 '24 16:10 Philipinho

Any update on this @Philipinho ?

mobley-trent avatar Nov 05 '24 10:11 mobley-trent

PTAL @Philipinho

mobley-trent avatar Nov 22 '24 08:11 mobley-trent

@Philipinho I opted to auto-reload the page to handle the state

mobley-trent avatar Mar 05 '25 14:03 mobley-trent

One of the issues I encountered the last time I tried it was, If a page with children gets deleted and the child of a deleted page gets restored, the child and it's children gets lost and does not appear in the sidebar.

Philipinho avatar Mar 05 '25 15:03 Philipinho

One of the issues I encountered the last time I tried it was, If a page with children gets deleted and the child of a deleted page gets restored, the child and it's children gets lost and does not appear in the sidebar.

I handled this by setting the parentPageId to null when restoring a page. This effectively ensures that the restored page and child pages are restored as root pages in the sidebar.

mobley-trent avatar Mar 06 '25 05:03 mobley-trent