Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 3.76 KB

UserGuide.md

File metadata and controls

61 lines (47 loc) · 3.76 KB

User Guide

In this project, we added two new features:

  1. A search bar that can search for topics within a category.
  2. A system to tag questions as answered/closed and tag answers as verified by a teacher (similar to Piazza)

The front-end components of these new features are implemented using our custom theme: nodebb-theme-slackers.

Using our custom theme

Here is how to set up and use our custom theme.

Add it to node_modules

  1. Make sure the directory nodebb-theme-slackers is located in the root directory (along with public, src for example)
  2. Navigate to nodebb-theme-slackers (run cd nodebb-theme-slackers/ from the root directory)
  3. Run npm link
  4. Navigate back to the root directory (run cd ..)
  5. Run npm link nodebb-theme-slackers

Use the new custom theme

  1. After making sure NodeBB is not running (run ./nodebb stop), run ./nodebb reset -t nodebb-theme-slackers. Now our new custom theme will be used when NodeBB is relaunched.
  2. Make sure redis-server is running so that we can launch our project.
  3. Launch NodeBB in your preferred way:
./nodebb reset -t nodebb-theme-slackers && ./nodebb build && ./nodebb start
  1. Go to http://localhost:4567/ to see the new theme in action!

Search bar

How to use

Our search bar component is found under any category. After launching the local NodeBB app, navigate to a category (such as General Discussion or Announcements).

If you set up the theme properly, you should see a search bar in between the title and the tags/filters. Simply click on this search bar and type a search query. If there are existing topics within this category that contain that search query, they will be displayed. You can still click on any of these topics after being filtered and it will properly navigate you to within the topic.

Automated testing

The automated tests for the search bar component can be found in the tests/search.js file. The key aspects covered in these tests include: Search by Query in Titles and Posts: Ensures that searching for a keyword returns the correct topics and posts containing that keyword within a category. User-based Search: Confirms that searching for a specific user returns the correct results. Tag-based Search: Verifies that searching for specific tags brings back topics tagged appropriately. Category-based Search: Ensures that search results within a category and its subcategories return accurate matches. Error Handling: Tests that incorrect or empty search queries are handled gracefully, returning appropriate error messages or undefined results. These tests validate searching within categories, ensuring proper results are returned for different search queries, and also check for edge cases like empty queries or invalid filters.

Tags

How to use

Navigate to the project root directory. Run npm run test to execute all tests after lint etc

Verify Message

How to use

Our verify message component is found under the dropdown beside a post. Notice how there is a cross beside the post/comment. This indicates that the post/comment is not yet verified. If you are an administrator or moderator, you can click verify message to verify the post/comment. Refresh the page to notice that the cross has now been changed to a tick.

Automated testing

Automated tests for permissions and for backend APIs for verify/unverify message can be found in tests/posts.js.

Answer Question

How to use

The Answer question component works similarly to the verify message functionality. You can navigate to a topic and click on the dropdown tools. There will then be a "answer/unanswer" button. When pressed you can see a tag appear under the topic title stating if it has been answered.

Automated testing

Automated tests for the backend can be found in tests/topics.js.