From 41e89063121990f6e91ba2a4453c7f6f341c549c Mon Sep 17 00:00:00 2001 From: fannta1990 Date: Mon, 9 Feb 2026 21:08:18 +0800 Subject: [PATCH] Add review and rating features with sorting and filtering options - Implemented a new ReviewController to handle review creation, updates, and retrieval for library items. - Added pagination, sorting, and filtering capabilities for reviews in the API. - Updated frontend components to support review display, including a new ReviewsTable and enhanced ratings UI. - Introduced new strings for user interface elements related to reviews and ratings. - Added tests for the ReviewController and Review model to ensure functionality and validation. - Enabled the option to toggle the review feature in server settings. --- client/components/modals/ReviewModal.vue | 6 + client/components/tables/ReviewsTable.vue | 5 + client/components/ui/StarRating.vue | 9 + client/pages/library/_library/ratings.vue | 225 +++++++++++++++--- client/strings/en-us.json | 9 + server/Server.js | 1 + server/controllers/ReviewController.js | 104 ++++++++ server/models/Review.js | 33 ++- server/objects/settings/ServerSettings.js | 2 + server/routers/ApiRouter.js | 1 + .../controllers/ReviewController.test.js | 154 ++++++++++++ test/server/models/Review.test.js | 97 ++++++++ 12 files changed, 603 insertions(+), 43 deletions(-) create mode 100644 test/server/controllers/ReviewController.test.js create mode 100644 test/server/models/Review.test.js diff --git a/client/components/modals/ReviewModal.vue b/client/components/modals/ReviewModal.vue index 1a57d79e3..2e7d1d048 100644 --- a/client/components/modals/ReviewModal.vue +++ b/client/components/modals/ReviewModal.vue @@ -30,6 +30,12 @@