US9 - Backend functionality for "Resolved" feature #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
What
This pull request introduces the full backend functionality for the new "Mark as Resolved" button, ensuring it interacts smoothly with the system's API, routes, and controllers.
Why
Completes issue #21 and #22, completes user story 9.
How
The implementation covers the following aspects:
Screenshot 1: Displaying the "Mark as Resolved" button in the UI
Screenshot 2: The topic marked as resolved, displaying the badge
Screenshot 3: Backend log confirming the status update
Testing
Automated tests are added in
test/topics.js
, testing (1) default topic as unresolved and (2) admin(instructor) should be able to mark topic as resolved.Problems and Explanation
A linter error related to the front-end repository and themes caused the GitHub checks to fail, despite all local tests passing. After a thorough review and investigation, our group TA confirmed that this issue does not affect the core functionality. As demonstrated in the section above, the core functionality is working as expected. In the following section, I will provide a detailed explanation of the issue and its underlying causes.
Local tests passed:
Linter issue explanation:
The following error occurred:
Error: ENOENT: no such file or directory, open '/home/runner/work/nodebb-f24-the-turtles/nodebb-f24-the-turtles/node_modules/nodebb-theme-harmony/theme.json'
This was caused by modifying the front-end theme dependency in package.json:
"nodebb-theme-harmony": "file:../nodebb-frontend-f24-the-turtles"
This change links the theme to a local repository (link) where I developed the front-end changes. This error is difficult to avoid because it stems from linking a local repository, which bypasses the usual npm installation process that ensures all necessary files like theme.json are present.