Skip to content

Student categories feature#14

Closed
salemadi06 wants to merge 36 commits into
mainfrom
student-categories-feature
Closed

Student categories feature#14
salemadi06 wants to merge 36 commits into
mainfrom
student-categories-feature

Conversation

@salemadi06

Copy link
Copy Markdown

We added a new privilege called topics:subcategories_create in NodeBB’s category privilege map. This makes it appear in the Admin Control Panel (ACP), just like “Create Topics” or “Reply to Topics.” It can now be granted or denied to specific groups. Admins can grant the “Create Subcategories” permission to different groups. Changed the permission errors to allow or give an error based on the permissions.

Created a frontend button to ‘add subcategory’ in src/views/partials/category/watch.tpl. Added the backend feature in the public/src/client/category.js. By clicking the button users can access a form where they can enter a subcategory name and description, that will be forwarded to the API

Testing: the user sees a confirmation message and the page refreshes to show the new subcategory in manual UI testing

@aadalbek aadalbek added the enhancement New feature or request label Sep 28, 2025
@salemadi06

Copy link
Copy Markdown
Author

This pull request is still open as one of the Node tests is failing because the response status code should match one of the schema defined responses.

@aadalbek

Copy link
Copy Markdown

Could not close the PR due to an error of response status code not matching one of the schema defined responses for POST /categories.
First, we got the error about 500 status code , but then we tried to respond with an error handled by 418 status and tried to add it to the OpenAPI schema, which only has '200 success' response. Still faced the test assertion error. To resolve this we will work on the backend logic and testing in our Sprint 2, to test valid and valid inputs, try to update OpenAPI schema once again and regenerate the tests.

@aadalbek

aadalbek commented Oct 8, 2025

Copy link
Copy Markdown

We made sure that all of the required fields in the backend were checked, then tried to write our own responses as ‘400’ or ‘418’, which then replaced the ‘500 status code error’. So, even if our manual testing was passing, and we think that our backend logic also works correctly (as we see warning error messages that are supposed to prevent the failure responses in schema), we could not successfully pass the nodebb test (npm test). Also, the more changes we did to the code, more new errors started occurring, besides the OpenAPI schema failure. So , we could not find the solution by the end of Sprint 2 also, given the time constraints and due to us not finding a way to fix it, we came to a conclusion to close the PR unfortunately.

@aadalbek aadalbek closed this Oct 8, 2025
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.

2 participants