Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: Fix users not being able to submit a second feedback #218

Closed
wants to merge 42 commits into from

Conversation

SheepTester
Copy link
Member

@SheepTester SheepTester commented Apr 2, 2024

Info

Currently, users can only submit one feedback in their lifetimes, since the rest of the events will list that one feedback they submitted instead of allowing them to submit feedback for that event.

This is because currently, the event page uses query parameters to filter feedback by user and event ID. However, these query parameters are ignored if the user doesn't have the permission to see all feedback.

I think this is an issue with the backend's design, but whatever. Instead, this now fetches all feedback (for admins, this will fetch every feedback ever submitted) and then filters through that array. This matches the current behavior of checking for attendance: to check if a user has attended a specific event, it fetches the user's entire attendance history then looks up the event ID.

Reproduction steps:

  1. Create a normal user account
  2. Give feedback for one past event
  3. Attempt to give feedback for another past event. Currently, the page will show the feedback given in Add SEO Link Previews to the Website #2 on the second event's page. This PR fixes the issue and will allow the user to give feedback for the second event.

Changes

  • Fetch all feedback and filter the array by user and event ID, rather than relying the backend's filters

Type of Change

  • Bug Fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • Logistics Change (A change to a README, description, or dev workflow setup like
    linting/formatting)
  • Continuous Integration Change (Related to deployment steps or continuous integration
    workflows)
  • Other: (Fill In)

Testing

I have tested that my changes fully resolve the linked issue ...

  • locally on Desktop.
  • on the live deployment preview on Desktop.
  • on the live deployment preview on Mobile.
  • I have added new Cypress tests that are passing.

Checklist

  • I have performed a self-review of my own code.
  • I have followed the style guidelines of this project.
  • I have documented any new functions in /src/lib/* and commented hard to understand areas
    anywhere else.
  • My changes produce no new warnings.

Screenshots

1. Can open multiple events in a new tab
2. Can't have a feedback <form> inside a modal
turns out you can't change status after responding
And add titles to new pages
change currentColor borders to elevated-stroke
Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
membership-portal-ui-v2 ✅ Ready (Inspect) Visit Preview Apr 2, 2024 5:06am

@SheepTester
Copy link
Member Author

fixed by acmucsd/membership-portal#424

@SheepTester SheepTester closed this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant