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

Implemented endorse post backend + Fixed Anon Refresh #34

Merged
merged 8 commits into from
Feb 26, 2025

Conversation

savannahxunc
Copy link
Contributor

@savannahxunc savannahxunc commented Feb 24, 2025

Anonymous Refresh Fix: This new code fixes the bug that we have been working on with the anonymous refresh. The anonymous name would show up but upon refresh, everything would just revert back to the default settings. There was likely a database overriding that was happening due to the cascading nature of the database. The change was made, but it did not completely update in all parts of the database. Solution: Changed in post.tpl to check a boolean field rather than for a string field.

Endorse post backend: Started implementing the backend for the endorse feature. Because of the headache caused by creating a new field in the database for the anonymous reply feature, I decided to find a work around.

  • Utilizing the already existing field of "flags" that allows multiple values to be stored made our lives esaier. We had to add an extra drop down option for flagging called "Endorsed by Admin". After a post was flagged, it would be stored in the database under the flagged field with the specific "Endorsed by Admin" token. This way, We can access this and display it on the front end.

Anonymous Feature Working:
Screenshot 2025-02-24 at 4 23 19 PM

"Flagging" a post as "Endorsed by Admin", first click into the "⋮" menu and click "Flag this Post" then click on the "Endorsed by Admin" in the following screen.
Screenshot 2025-02-24 at 11 06 19 PM

Screenshot 2025-02-24 at 4 23 50 PM

Backend (in Admin dashboard) shows that the post is sucessfully "Endorsed by Admin"
Screenshot 2025-02-24 at 4 24 42 PM

To Dos:
Implement front end display of endorsed post on the top right of a post.

  • This would be done by searching in the Database for where the flagged item is equal to "Endorsed by Admin" (exact logic TBD, need to understanf DB better), then display this in the post.tpl file.

resolves #28 and #24

@coveralls
Copy link

coveralls commented Feb 24, 2025

Pull Request Test Coverage Report for Build 13534500688

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 82.603%

Files with Coverage Reduction New Missed Lines %
src/notifications.js 1 79.27%
Totals Coverage Status
Change from base Build 13278022055: 0.003%
Covered Lines: 22378
Relevant Lines: 25666

💛 - Coveralls

@savannahxunc savannahxunc marked this pull request as ready for review February 25, 2025 04:12
@savannahxunc savannahxunc added this to the Sprint 2 milestone Feb 25, 2025
@savannahxunc savannahxunc added the enhancement New feature or request label Feb 25, 2025
@savannahxunc savannahxunc self-assigned this Feb 25, 2025
Copy link
Contributor

@joonhoswe joonhoswe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Savannah, this looks great! I know this is a bug you've been working on for a long time, great work fixing it. I'll go ahead and check out from this branch after merging, and then add the endorse frontend.

@joonhoswe joonhoswe merged commit 46c4ad3 into main Feb 26, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build Backend logic for Endorse by Instructor
3 participants