Skip to content

Add campaign-scoped favorites for jurors#387

Open
Oyelakin-Mercy wants to merge 1 commit intohatnote:masterfrom
Oyelakin-Mercy:feat/add-favourite-button
Open

Add campaign-scoped favorites for jurors#387
Oyelakin-Mercy wants to merge 1 commit intohatnote:masterfrom
Oyelakin-Mercy:feat/add-favourite-button

Conversation

@Oyelakin-Mercy
Copy link

Fixes #333

Some Jurors have vote a lot of pictures, and scrolling through so many to see their favorite is stressful. This PR adds a "View Favorites" button to the juror campaign card, which allows them to quickly go to to their favorited images for a specific campaign.

Changes:

Frontend

  • JurorCampaignCard.vue: Added a "View Favorites" button with a heart icon that navigates to the new faves view for the campaign
  • VoteRating.vue, VoteYesNo.vue, VoteRanking.vue: Added a "View Favorites" button alongside the existing "Edit previous votes" button in both the active voting view and the all-done state
  • router/index.js: Added new /vote/:id/faves route pointing to FavesView
  • jurorService.js: Updated getFaves to accept campaignId and offset parameters
  • en.json: Added montage-my-campaign-faves i18n string ("View Favorites")

Backend

  • juror_endpoints.py: Updated get_faves endpoint to accept and pass campaign_id filter
  • rdb.py:
    • JurorDAO.get_faves: Added campaign_id filter and fixed a bug where offset was hardcoded to 0
    • JurorDAO.fave: Fetch round_entry before checking for existing fave so campaign_id is available for scoping; fixes potential cross-campaign fave collisions
    • JurorDAO.unfave: Scoped unfave lookup by campaign_id and status; changed .one() to .one_or_none() to handle gracefully if fave doesn't exist
    • Vote.check_fave: Added campaign_id lookup so fave checks are scoped to the correct campaign
Screenshot 2026-02-27 124008

@Oyelakin-Mercy Oyelakin-Mercy force-pushed the feat/add-favourite-button branch 5 times, most recently from 6b582d4 to a373c6a Compare February 27, 2026 21:23
@Oyelakin-Mercy Oyelakin-Mercy force-pushed the feat/add-favourite-button branch from a373c6a to 68cf1e3 Compare February 27, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No link to favorites on the main page

1 participant