[PR #947] [MERGED] Bookshelves #5741

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

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/947
Author: @ssddanbrown
Created: 8/4/2018
Status: Merged
Merged: 9/21/2018
Merged by: @ssddanbrown

Base: masterHead: bookshelves


📝 Commits (10+)

  • 4948b44 Started work on bookshelves
  • b5a2d3c Merge remote-tracking branch 'origin' into bookshelves
  • c3986ce Added shelve icon, improved migration, added role permission
  • b89411c Copied book content, Added create routes
  • f455b31 Added ability to click books in shelf-sort
  • 47b0888 Added bookshelf view, update, delete
  • 81eb642 Added bookshelves homepage options
  • 0b6f838 Removed joint_permission generation in older migration
  • 6eead43 Added bookshelf permission control UI and copy-down ability
  • 8ff969d Updated so permission effect admins more

📊 Changes

61 files changed (+2098 additions, -208 deletions)

View changed files

📝 app/Book.php (+9 -8)
app/Bookshelf.php (+84 -0)
📝 app/Entity.php (+1 -1)
app/Http/Controllers/BookshelfController.php (+244 -0)
📝 app/Http/Controllers/HomeController.php (+28 -28)
📝 app/Http/Controllers/UserController.php (+24 -1)
📝 app/Repos/EntityRepo.php (+103 -18)
📝 app/Repos/PermissionsRepo.php (+10 -5)
📝 app/Services/PermissionService.php (+50 -48)
📝 database/factories/ModelFactory.php (+8 -0)
📝 database/migrations/2016_04_20_192649_create_joint_permissions_table.php (+0 -4)
database/migrations/2018_08_04_115700_create_bookshelves_table.php (+101 -0)
📝 database/seeds/DummyContentSeeder.php (+15 -9)
📝 package-lock.json (+15 -0)
📝 package.json (+1 -0)
resources/assets/icons/bookshelf.svg (+2 -0)
resources/assets/js/components/homepage-control.js (+22 -0)
📝 resources/assets/js/components/index.js (+2 -0)
📝 resources/assets/js/components/page-picker.js (+8 -6)
resources/assets/js/components/shelf-sort.js (+71 -0)

...and 41 more files

📄 Description

For #95

Full proposal and discussion can be seen here.

Implementation Notes

  • Role permissions are copied from Books on creation.
  • As part of implementation, Have changed the way homepage setting is stored, May cause change upon update, Include in release notes.
  • To prevent new migration issues, join_permission generation has been removed from older migration. Might have to add note to upgrade guide, to run permission regen, for users upgrading from much older BookStack version.
  • Search index rebuild is also removed.
  • Asset permissions can now be set on admin role (Although joint permissions are still given).
  • Header link for bookshelves will hide if no role-level view permission is given.

Progress

  • Sit above Books in the hierarchy.
  • Can only contain Books as direct children.
  • Many-to-many relationship with Books so a single Book can be part of multiple BookShelves.
  • Will have a name, description, tags & cover image like Books currently have.
  • Will have permissions but they won't dynamically cascade down (But maybe have an option to apply shelf permissions to all included Books).
  • Accessible as a header link as Books are now.
  • Will have homepage option of BookShelves listing.
  • Will be optional at a system level (Either through permissions or direct setting).
  • Testing coverage

🔄 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/947 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 8/4/2018 **Status:** ✅ Merged **Merged:** 9/21/2018 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `bookshelves` --- ### 📝 Commits (10+) - [`4948b44`](https://github.com/BookStackApp/BookStack/commit/4948b443b6ce3088fbdf99dbdc1d7621d1eb73c4) Started work on bookshelves - [`b5a2d3c`](https://github.com/BookStackApp/BookStack/commit/b5a2d3c1c423d81b80fd7034a33ada85863a29ad) Merge remote-tracking branch 'origin' into bookshelves - [`c3986ce`](https://github.com/BookStackApp/BookStack/commit/c3986cedfc992abfe12c8ad596e949dbaf35a093) Added shelve icon, improved migration, added role permission - [`b89411c`](https://github.com/BookStackApp/BookStack/commit/b89411c108f08248215421a34bbf66bdf072d049) Copied book content, Added create routes - [`f455b31`](https://github.com/BookStackApp/BookStack/commit/f455b317ec1a562363b6ec55f63532246def931b) Added ability to click books in shelf-sort - [`47b0888`](https://github.com/BookStackApp/BookStack/commit/47b08888ba053375541d503682d503d2fd62ecee) Added bookshelf view, update, delete - [`81eb642`](https://github.com/BookStackApp/BookStack/commit/81eb642f752efaca71b13704996c53ec308be8fe) Added bookshelves homepage options - [`0b6f838`](https://github.com/BookStackApp/BookStack/commit/0b6f83837b779a81f3258f6485dbf8703997a495) Removed joint_permission generation in older migration - [`6eead43`](https://github.com/BookStackApp/BookStack/commit/6eead437d86eb4a1be07d03fe23bd756555cb509) Added bookshelf permission control UI and copy-down ability - [`8ff969d`](https://github.com/BookStackApp/BookStack/commit/8ff969dd17475fe25c862825f5cdbed66ffc9bbd) Updated so permission effect admins more ### 📊 Changes **61 files changed** (+2098 additions, -208 deletions) <details> <summary>View changed files</summary> 📝 `app/Book.php` (+9 -8) ➕ `app/Bookshelf.php` (+84 -0) 📝 `app/Entity.php` (+1 -1) ➕ `app/Http/Controllers/BookshelfController.php` (+244 -0) 📝 `app/Http/Controllers/HomeController.php` (+28 -28) 📝 `app/Http/Controllers/UserController.php` (+24 -1) 📝 `app/Repos/EntityRepo.php` (+103 -18) 📝 `app/Repos/PermissionsRepo.php` (+10 -5) 📝 `app/Services/PermissionService.php` (+50 -48) 📝 `database/factories/ModelFactory.php` (+8 -0) 📝 `database/migrations/2016_04_20_192649_create_joint_permissions_table.php` (+0 -4) ➕ `database/migrations/2018_08_04_115700_create_bookshelves_table.php` (+101 -0) 📝 `database/seeds/DummyContentSeeder.php` (+15 -9) 📝 `package-lock.json` (+15 -0) 📝 `package.json` (+1 -0) ➕ `resources/assets/icons/bookshelf.svg` (+2 -0) ➕ `resources/assets/js/components/homepage-control.js` (+22 -0) 📝 `resources/assets/js/components/index.js` (+2 -0) 📝 `resources/assets/js/components/page-picker.js` (+8 -6) ➕ `resources/assets/js/components/shelf-sort.js` (+71 -0) _...and 41 more files_ </details> ### 📄 Description For #95 Full proposal and discussion [can be seen here](https://github.com/BookStackApp/BookStack/issues/95#issuecomment-399753699). ### Implementation Notes - Role permissions are copied from Books on creation. - As part of implementation, Have changed the way homepage setting is stored, May cause change upon update, Include in release notes. - To prevent new migration issues, join_permission generation has been removed from older migration. Might have to add note to upgrade guide, to run permission regen, for users upgrading from much older BookStack version. - Search index rebuild is also removed. - Asset permissions can now be set on admin role (Although joint permissions are still given). - Header link for bookshelves will hide if no role-level view permission is given. ### Progress - [x] Sit above Books in the hierarchy. - [x] Can only contain Books as direct children. - [x] Many-to-many relationship with Books so a single Book can be part of multiple BookShelves. - [x] Will have a name, description, tags & cover image like Books currently have. - [x] Will have permissions but they won't dynamically cascade down (But maybe have an option to apply shelf permissions to all included Books). - [x] Accessible as a header link as Books are now. - [x] Will have homepage option of BookShelves listing. - [x] Will be optional at a system level (Either through permissions or direct setting). - [x] Testing coverage --- <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:15:50 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5741