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

[READY FOR REVIEW] Frontend for Unanswered Question Filter #19

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

SubtoFelix
Copy link
Contributor

📝 Context

This PR introduces the unanswered question feature in the UI of NodeBB.
With the unanswered questions button added to the database, the users can filter questions to only unanswered ones. With this feature added, the TA/instructor will have an easier time prioritizing which students' questions still need to be answered.

Changes in Codebase

  • Create an Unanswered Question Button next to the Recently Replied Sort Dropdown Menu on the filter bar.
    Modified: nodebb-theme-harmony/templates/partials/topic-list-bar.tpl
    Modified: custom-theme/templates/partials/topic-list-bar.tpl
  • Link nodebb-theme-harmony to NodeBB to get the frontend changes to show up.
    Modified: package.json
  • Copy nodebb-theme-harmony folder, change its name to custom-theme, and link it to nodebb to get the frontend changes to show up.
    Create: custom-theme folder (all content same as nodebb-theme-harmony)
  • Add client-side functionality in the script below where the button is implemented to filter and display unanswered topics when a user clicks the unanswered question button
    Modified: nodebb-theme-harmony/templates/partials/topic-list-bar.tpl
    Modified: custom-theme/templates/partials/topic-list-bar.tpl

🧠 Summary of Changes

The unanswered button UI is created next to the Recently Replied Sort Dropdown Menu alongside other filter options in the filter bar. Added a script that implements client-side functionality to filter and display only questions that are unanswered when a user clicks the button. This script essentially replaces a full page load with an AJAX-based update that only refreshes the topics list.

SubtoFelix and others added 24 commits February 9, 2025 20:48
…ew css class, and wrote down some tests to identify the correct template files
…ere's a reply, and create a new file for redis to show all unanswered questions
… and to categoryTopicSort in settings.tpl. Modified language file to include the unanswered questions key
…theme-harmony/templates/partials/category/sort.tpl, remove commented-out code from src/categories/index.js, and remove unanswered question option in validSorts in src/controllers/category.js
…et unanswered questions api completely working
…trollers and installed new jest framework reflected in package.json
…ed test/controllers/topics.js to modify formatting of output to adhere to schema expectations. changed public/openapi/read.yaml to add definition of unanswered api
…/controllers.js and deleted the created directory of test/controllers/ because it was not synced properly with other tests; also fixed all lint issues. added chai to devDependencies in package.json
…es/partials/topic-list-bar.tpl and copy nodebb-theme-harmony folder and change its name to custom-theme and link it to nodebb to get the frontend changes to work
…tpl and add route to src/routes/index.js to fetch api and render topic_list.tpl with unanswered topics
…ording to Sophia's code in src/controllers/topics.js and src/routes/api.js. And add unanswered question button functionaly in javascript in nodebb-theme-harmony/templates/partials/topic-list-bar.tpl and custom-theme/templates/partials/topic-list-bar.tpl
…ed.js since it's not needed for testing anymore
…rc/posts/create.js, and src/topics/create.js. Modified test version in package.json
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.

2 participants