[PR #2748] [MERGED] Favourite System #6060

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

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/2748
Author: @ssddanbrown
Created: 5/16/2021
Status: Merged
Merged: 5/23/2021
Merged by: @ssddanbrown

Base: masterHead: favourite_system


📝 Commits (10+)

  • bf8e7f3 Started addition of favourite system
  • db9aa41 Started writing testing for favourites
  • 3ca1491 Added faviourtes to other entity types
  • 93fd869 Started refactoring of view service
  • 3de0256 Started building system for cross-model queries
  • d0ff79e Revamped some complex queries, added favourites to home
  • 27942f5 Deleted redundant complex relationmultimodel query class
  • 1e0aa7e Added favourites page with link from header and home
  • c2069f3 Added deletion of favourites on entity/user delete
  • ba8ba5c Added testing to favourite system

📊 Changes

44 files changed (+592 additions, -167 deletions)

View changed files

app/Actions/Favourite.php (+17 -0)
📝 app/Actions/View.php (+41 -2)
app/Actions/ViewService.php (+0 -117)
📝 app/Auth/Permissions/PermissionService.php (+3 -2)
📝 app/Auth/User.php (+9 -0)
📝 app/Auth/UserRepo.php (+1 -0)
📝 app/Config/app.php (+0 -2)
📝 app/Console/Commands/ClearViews.php (+2 -1)
📝 app/Entities/Models/Entity.php (+22 -1)
app/Entities/Queries/EntityQuery.php (+17 -0)
app/Entities/Queries/Popular.php (+29 -0)
app/Entities/Queries/RecentlyViewed.php (+32 -0)
app/Entities/Queries/TopFavourites.php (+33 -0)
📝 app/Entities/Tools/TrashCan.php (+1 -0)
app/Facades/Views.php (+0 -16)
📝 app/Http/Controllers/BookController.php (+2 -1)
📝 app/Http/Controllers/BookshelfController.php (+2 -1)
📝 app/Http/Controllers/ChapterController.php (+2 -1)
app/Http/Controllers/FavouriteController.php (+95 -0)
📝 app/Http/Controllers/HomeController.php (+6 -3)

...and 24 more files

📄 Description

TODO

  • Rollout to chapters, books, shelves.
  • Homepage listing (Limited amount, most viewed prioritized)
  • Complete listing
  • Delete favourites on entity delete.
  • Testing

Implementation

Homepage "My Most Viewed Favourites"

Screenshot from 2021-05-23 14-40-25

Header "My Favourites" option

Screenshot from 2021-05-23 14-41-56

"My Favourites" page

Screenshot from 2021-05-23 14-42-24

"Favourite" action on an item

Screenshot from 2021-05-23 14-44-44


🔄 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/2748 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 5/16/2021 **Status:** ✅ Merged **Merged:** 5/23/2021 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `favourite_system` --- ### 📝 Commits (10+) - [`bf8e7f3`](https://github.com/BookStackApp/BookStack/commit/bf8e7f3393d48e6300c4d8775daeb40d55ea2017) Started addition of favourite system - [`db9aa41`](https://github.com/BookStackApp/BookStack/commit/db9aa410960ed38ebdbae2ee6ce0ac44ee0eb068) Started writing testing for favourites - [`3ca1491`](https://github.com/BookStackApp/BookStack/commit/3ca149137e5b33422f82456e1512fba417322968) Added faviourtes to other entity types - [`93fd869`](https://github.com/BookStackApp/BookStack/commit/93fd869ba36cb8e74690af95d28236084d159b63) Started refactoring of view service - [`3de0256`](https://github.com/BookStackApp/BookStack/commit/3de02566bf199f3a49fcfe2b2d4119a287eb26bb) Started building system for cross-model queries - [`d0ff79e`](https://github.com/BookStackApp/BookStack/commit/d0ff79ea6010f71861ce687c1f768264db3978e1) Revamped some complex queries, added favourites to home - [`27942f5`](https://github.com/BookStackApp/BookStack/commit/27942f5ce8cf2a18073cc8a933aea6fcce6ffe3e) Deleted redundant complex relationmultimodel query class - [`1e0aa7e`](https://github.com/BookStackApp/BookStack/commit/1e0aa7ee2cf88c53e110ffc0ee51884c37b7509c) Added favourites page with link from header and home - [`c2069f3`](https://github.com/BookStackApp/BookStack/commit/c2069f37cc9c909c66e89dac6b9b2f2249855f5e) Added deletion of favourites on entity/user delete - [`ba8ba5c`](https://github.com/BookStackApp/BookStack/commit/ba8ba5c63421881d9346cbd6dd09a28943ff84ef) Added testing to favourite system ### 📊 Changes **44 files changed** (+592 additions, -167 deletions) <details> <summary>View changed files</summary> ➕ `app/Actions/Favourite.php` (+17 -0) 📝 `app/Actions/View.php` (+41 -2) ➖ `app/Actions/ViewService.php` (+0 -117) 📝 `app/Auth/Permissions/PermissionService.php` (+3 -2) 📝 `app/Auth/User.php` (+9 -0) 📝 `app/Auth/UserRepo.php` (+1 -0) 📝 `app/Config/app.php` (+0 -2) 📝 `app/Console/Commands/ClearViews.php` (+2 -1) 📝 `app/Entities/Models/Entity.php` (+22 -1) ➕ `app/Entities/Queries/EntityQuery.php` (+17 -0) ➕ `app/Entities/Queries/Popular.php` (+29 -0) ➕ `app/Entities/Queries/RecentlyViewed.php` (+32 -0) ➕ `app/Entities/Queries/TopFavourites.php` (+33 -0) 📝 `app/Entities/Tools/TrashCan.php` (+1 -0) ➖ `app/Facades/Views.php` (+0 -16) 📝 `app/Http/Controllers/BookController.php` (+2 -1) 📝 `app/Http/Controllers/BookshelfController.php` (+2 -1) 📝 `app/Http/Controllers/ChapterController.php` (+2 -1) ➕ `app/Http/Controllers/FavouriteController.php` (+95 -0) 📝 `app/Http/Controllers/HomeController.php` (+6 -3) _...and 24 more files_ </details> ### 📄 Description ### TODO - [x] Rollout to chapters, books, shelves. - [x] Homepage listing (Limited amount, most viewed prioritized) - [x] Complete listing - [x] Delete favourites on entity delete. - [x] Testing ### Implementation #### Homepage "My Most Viewed Favourites" ![Screenshot from 2021-05-23 14-40-25](https://user-images.githubusercontent.com/8343178/119263003-3bc31180-bbd5-11eb-9836-96d281743015.png) #### Header "My Favourites" option ![Screenshot from 2021-05-23 14-41-56](https://user-images.githubusercontent.com/8343178/119263014-45e51000-bbd5-11eb-9f25-275a07cf3a3b.png) ##### "My Favourites" page ![Screenshot from 2021-05-23 14-42-24](https://user-images.githubusercontent.com/8343178/119263026-4f6e7800-bbd5-11eb-9e52-510e0b3d0421.png) #### "Favourite" action on an item ![Screenshot from 2021-05-23 14-44-44](https://user-images.githubusercontent.com/8343178/119263063-72009100-bbd5-11eb-9e42-34874995c2d3.png) --- <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:23: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#6060