Student categories feature#14
Conversation
… student-categories-feature
|
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. |
|
Could not close the PR due to an error of response status code not matching one of the schema defined responses for POST /categories. |
…on.yaml for the name erro
|
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. |
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