Authors: Angela Kim, Veronica Pimenova, Crystal Cheng, Eric Lin
This is the user documentation for our project. It explains the features, setup instructions, and usage details.
The Anonymous Posting feature allows users to make a post without having their name/profile attached to the post publicly. This feature provides more flexibility for users, giving them the option to post anonymously.
Key Functionality:
- Mark post as anonymous: When drafting a post, users will see a checkbox that allows them to modify the anonymous status of the post.
- Post displays as anonymous: Upon posting, the post shows up without a profile picture or name associated with the post author.
The isAnswered
feature helps track the status of topics in the forum, allowing users to identify which topics have received a satisfactory response. It is useful for Q&A or support forums where users focus on unanswered queries.
Key Functionality:
- Mark Topics as Answered: Users with the necessary privileges can mark a topic as answered.
- Display Answer Status: The status (
Answered
orUnanswered
) is displayed on the topic list view. - Restrict Marking Privileges: The ability to toggle the
isAnswered
status can be restricted to specific users.
The Emoji Reactions feature lets users express their sentiments on posts by reacting with emojis. This provides a lightweight and intuitive way for users to engage with posts.
Key Functionality:
- React to Posts: Users can choose from a set of emojis to react to a post.
- View Reactions: The total number of reactions and specific emojis used are displayed under each post.
- Remove Reactions: Users can remove their reactions if they no longer wish to associate them with a post.
- Backend Field Handling: A field
isAnonymous
is added to handle the server requests associated with a post’s anonymity.- Relevant Files:
src/posts/summary.js
,src/topics/create.js
- Relevant Files:
- Backend Schema: The schema was expanded to include the
isAnonymous
field to match the response body of operations. - Frontend UI: A checkbox shows up next to the topic title for users to handle the anonymous state of each post.
- Integration: When the checkbox is checked and a post is published, a frontend trigger reflects this change.
- Backend Schema: A new column
isAnswered
was added to thetopics
table in the database to store the status of each topic. - API Endpoint (Internal):
- Endpoint:
/post/:pid/answered
- Method:
PUT
- Body:
{ "isAnswered": true }
- Endpoint:
- Frontend UI:
- Checkbox Display: A checkbox is added next to each post. It is checked if the post is answered and unchecked if unanswered.
- UI Placement: The checkbox is visible both in the main topic list and within the post detail view.
- Backend Schema: No new column was added. Emoji reactions leverage NodeBB’s existing reaction system.
- API Endpoints:
- Add Reaction:
- Endpoint:
/post/:pid/reaction
- Method:
PUT
- Body:
{ "reaction": "😊" }
- Endpoint:
- Remove Reaction:
- Endpoint:
/post/:pid/reaction
- Method:
DELETE
- Body:
{ "reaction": "😊" }
- Endpoint:
- Add Reaction:
- Frontend UI:
- Emoji Picker: Users see an emoji reaction icon next to the post content. Clicking it opens the emoji picker.
- Displaying Reactions: Selected emojis and counts are displayed below the post content.
- Front-End Testing:
- Verify that the anonymous checkbox is visible in the post creation UI.
- Ensure the checkbox hides the user’s name and profile picture when posting.
- Back-End Testing:
- Test that the
isAnonymous
field updates correctly in the database. - Verify the anonymous status persists across sessions.
- Test that the
- Front-End Testing:
- Ensure the checkbox toggles between "answered" and "unanswered" states.
- Verify the status is reflected correctly in both topic list and detail views.
- Back-End Testing:
- Test the API to confirm it updates the
isAnswered
status correctly. - Verify that the database saves and retrieves the correct status.
- Test the API to confirm it updates the
- Front-End Testing:
- Ensure the emoji picker appears and allows users to react to posts.
- Test that the reactions display correctly under the post and can be removed.
- Back-End Testing:
- Test the API to confirm reactions are added and removed correctly in the database.
- Verify that emoji counts update correctly when multiple users react.
- Setting a post as anonymous:
- Under a discussion, click "Create Topic".
- Check the "anonymous" checkbox near the post title.
- Submit the post.
- Viewing Anonymous Posts:
- The post will display as any other post but without the author’s name or profile picture.
- Permissions:
- Only the original poster can toggle the anonymous status.
- Marking a Post as Answered or Unanswered:
- Navigate to the post, locate the checkbox next to the title, and toggle it.
- Viewing Status:
- In the topic list and post view, the checkbox will indicate the post's current status.
- Permissions:
- Only the original poster or users with permissions can toggle the answer status.
- Adding a Reaction:
- Navigate to the post and click the emoji icon.
- Select an emoji from the picker, and it will display under the post.
- Removing a Reaction:
- Click on your selected emoji to remove it.
- Viewing Reactions:
- Reactions and counts are visible under the post content.
- The automated tests for these features can be found in the
/tests/
directory. These tests cover both front-end and back-end functionality for the Anonymous Posting, isAnswered, and Emoji Reactions features.
Testing Coverage:
- The tests include basic functionality, user interaction scenarios, and edge cases, ensuring the robustness of the features. We believe the tests are sufficient as they verify key user interactions, API calls, and data persistence across sessions.