feat: Recycle bin for deleted pages in space
Closes #59
POC
https://github.com/user-attachments/assets/e5668ef1-5b44-408b-86a3-43b09bb84d27
@Philipinho kindly review
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.
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.
https://github.com/user-attachments/assets/89b847e5-a0c6-4400-b72d-0015aa9914c9
Aside from removing it from the tree, do sub-pages get soft-deleted too? i.e deleted_at field updated for each sub-page.
Aside from removing it from the tree, do sub-pages get soft-deleted too? i.e
deleted_atfield 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.
The default deletion process auto deletes child pages via foreign key relationship.
@Philipinho I updated the remove (soft delete) and restore routes to fetch page ids for descendants as well.
Hi @Philipinho I would appreciate your feedback
@mobley-trent thank you for your work. I will get to it.
Any update on this @Philipinho ?
PTAL @Philipinho
@Philipinho I opted to auto-reload the page to handle the state
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.
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.