[PR #2283] [MERGED] Recycle Bin Implementation #5970

Closed
opened 2026-02-05 10:21:36 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/2283
Author: @ssddanbrown
Created: 9/28/2020
Status: Merged
Merged: 11/7/2020
Merged by: @ssddanbrown

Base: masterHead: recycle_bin


📝 Commits (10+)

  • 691027a Started implementation of recycle bin functionality
  • 04197e3 Started work on the recycle bin interface
  • ff7cbd1 Added recycle bin empty notification response with count
  • 9e03370 Added per-item recycle-bin delete and restore
  • 3e70c66 Cleaned up duplicate code in recycle-bin restore
  • 483cb41 Started testing work for recycle bin implementation
  • 68b1d87 Added test coverage of recycle bin actions
  • ec3aeb3 Added recycle bin auto-clear lifetime functionality
  • df10b50 Enhanced how activities are shown on items in recycle bin
  • b4da081 Checked over recycle bin parent/child flows

📊 Changes

48 files changed (+1225 additions, -184 deletions)

View changed files

📝 .env.example.complete (+8 -0)
📝 app/Actions/ActivityService.php (+4 -1)
📝 app/Actions/ViewService.php (+11 -14)
📝 app/Auth/Permissions/PermissionService.php (+4 -9)
📝 app/Config/app.php (+7 -0)
app/Entities/Deletion.php (+41 -0)
📝 app/Entities/Entity.php (+27 -2)
📝 app/Entities/EntityProvider.php (+1 -0)
📝 app/Entities/Managers/TrashCan.php (+241 -24)
📝 app/Entities/Page.php (+0 -8)
📝 app/Entities/Repos/BookRepo.php (+3 -3)
📝 app/Entities/Repos/BookshelfRepo.php (+2 -1)
📝 app/Entities/Repos/ChapterRepo.php (+2 -5)
📝 app/Entities/Repos/PageRepo.php (+8 -5)
📝 app/Entities/SearchService.php (+6 -3)
📝 app/Http/Controllers/AuditLogController.php (+6 -1)
📝 app/Http/Controllers/BookController.php (+1 -2)
📝 app/Http/Controllers/BookshelfController.php (+1 -1)
📝 app/Http/Controllers/ChapterController.php (+1 -1)
📝 app/Http/Controllers/HomeController.php (+6 -4)

...and 28 more files

📄 Description

This PR tracks the implementation of a recycle bin.

TODO

  • Update main entities with soft-delete functionality.
  • Add record of entities that were actioned, which also stores the user that made the deletion
  • Display the delete records in a "recycle bin".
  • Add ability to empty the recycle bin.
  • Check if a new permission needs to be added for recycle bin or if an existing one/combination can be used.
    • Decided on using a combination of settings-manage with restrictions-manage-all.
  • Implement top-level and sub-level restore, with target location selection (If no longer existing?).
  • Update tests and cover recycle bin system.
  • Add functionality to auto-remove items from the recycle bin after a configurable time.
  • Test edge-cases on related entities.
  • Think through edge-cases in regards to delete order.

Related to #2183


🔄 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/BookStackApp/BookStack/pull/2283 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 9/28/2020 **Status:** ✅ Merged **Merged:** 11/7/2020 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `recycle_bin` --- ### 📝 Commits (10+) - [`691027a`](https://github.com/BookStackApp/BookStack/commit/691027a522d43c5a52085b89abe3123596bf08cc) Started implementation of recycle bin functionality - [`04197e3`](https://github.com/BookStackApp/BookStack/commit/04197e393ac69934df85df76e5ba2c4361f5e1d4) Started work on the recycle bin interface - [`ff7cbd1`](https://github.com/BookStackApp/BookStack/commit/ff7cbd14fcdad963a7f53f788dabbb43ccd73b8b) Added recycle bin empty notification response with count - [`9e03370`](https://github.com/BookStackApp/BookStack/commit/9e033709a78824decbf959ea25ce8672b026da09) Added per-item recycle-bin delete and restore - [`3e70c66`](https://github.com/BookStackApp/BookStack/commit/3e70c661a183a510d1e999e38723489650a6b96f) Cleaned up duplicate code in recycle-bin restore - [`483cb41`](https://github.com/BookStackApp/BookStack/commit/483cb41665c9d5994b47c762670d5fd98188cf14) Started testing work for recycle bin implementation - [`68b1d87`](https://github.com/BookStackApp/BookStack/commit/68b1d87ebecd4f60a2d7b4c3dff481e9f905bb9a) Added test coverage of recycle bin actions - [`ec3aeb3`](https://github.com/BookStackApp/BookStack/commit/ec3aeb3315db201251e48b9d3713b022e7d88188) Added recycle bin auto-clear lifetime functionality - [`df10b50`](https://github.com/BookStackApp/BookStack/commit/df10b508d81150c3366bab78688fb95d768b3c31) Enhanced how activities are shown on items in recycle bin - [`b4da081`](https://github.com/BookStackApp/BookStack/commit/b4da08155255a50fae889bbc999414b6b64e3b6b) Checked over recycle bin parent/child flows ### 📊 Changes **48 files changed** (+1225 additions, -184 deletions) <details> <summary>View changed files</summary> 📝 `.env.example.complete` (+8 -0) 📝 `app/Actions/ActivityService.php` (+4 -1) 📝 `app/Actions/ViewService.php` (+11 -14) 📝 `app/Auth/Permissions/PermissionService.php` (+4 -9) 📝 `app/Config/app.php` (+7 -0) ➕ `app/Entities/Deletion.php` (+41 -0) 📝 `app/Entities/Entity.php` (+27 -2) 📝 `app/Entities/EntityProvider.php` (+1 -0) 📝 `app/Entities/Managers/TrashCan.php` (+241 -24) 📝 `app/Entities/Page.php` (+0 -8) 📝 `app/Entities/Repos/BookRepo.php` (+3 -3) 📝 `app/Entities/Repos/BookshelfRepo.php` (+2 -1) 📝 `app/Entities/Repos/ChapterRepo.php` (+2 -5) 📝 `app/Entities/Repos/PageRepo.php` (+8 -5) 📝 `app/Entities/SearchService.php` (+6 -3) 📝 `app/Http/Controllers/AuditLogController.php` (+6 -1) 📝 `app/Http/Controllers/BookController.php` (+1 -2) 📝 `app/Http/Controllers/BookshelfController.php` (+1 -1) 📝 `app/Http/Controllers/ChapterController.php` (+1 -1) 📝 `app/Http/Controllers/HomeController.php` (+6 -4) _...and 28 more files_ </details> ### 📄 Description This PR tracks the implementation of a recycle bin. ### TODO - [x] Update main entities with soft-delete functionality. - [x] Add record of entities that were actioned, which also stores the user that made the deletion - [x] Display the delete records in a "recycle bin". - [x] Add ability to empty the recycle bin. - [x] Check if a new permission needs to be added for recycle bin or if an existing one/combination can be used. - Decided on using a combination of `settings-manage` with `restrictions-manage-all`. - [ ] ~Implement top-level and sub-level restore, with target location selection (If no longer existing?)~. - [x] Update tests and cover recycle bin system. - [x] Add functionality to auto-remove items from the recycle bin after a configurable time. - [x] Test edge-cases on related entities. - [x] Think through edge-cases in regards to delete order. --- Related to #2183 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:21:36 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5970