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

Project 1 Changes Anuja #26

Merged
merged 3 commits into from
Sep 25, 2024
Merged

Project 1 Changes Anuja #26

merged 3 commits into from
Sep 25, 2024

Conversation

heyanuja
Copy link

chose to work on the src/categories/create.js file! I think the file is rresponsible for creating new categories in the NodeBB forum. It contains logic for generating a new category ID, handling parent child relationships between categories, setting attributes(name, description, color, and order) and saving this info to the database. It manages category permissions for different user groups (registered users, guests, admins like me), and fires hooks for plugins though im not totally sure what that does. The refactored portion of the file reduces the cognitive complexity of the category creation process by separating object construction into its own function, createCategory.
To manually test refactored code and ensure it was executed during the NodeBB instance's
runtime, I added a print statement (console.log('Anuja - createCategory')) within the refactored
createCategory function.
This allowed me to verify that the function was triggered when an action related to category
creation occurred.
However, during the manual testing process, I encountered an issue when trying to add a new
category through the Admin Panel. Specifically, the "Add Category" button on the categories
management page didn't trigger the expected UI behavior but the console also stayed empty. This
issue could be related to configuration or permissions in the local instance setup or maybe it just
did’nt work.
Additionally, after restarting the NodeBB instance and reviewing the logs using the ./nodebb log
command, I encountered an error related to fetching the latest version of NodeBB, but no log
output from the console.log('Anuja - createCategory') statement. This indicates that while I
couldn't really fully validate the refactored code execution through the UI or logs, the refactored
code itself was integrated correctly based on the steps I followed. So the llimitation prevented a
full UI based validation of the createCategory function, but it did not affect the core functionality
of the refactoring, which reduced the cognitive complexity of the code.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11025936155

Details

  • 9 of 9 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 82.656%

Totals Coverage Status
Change from base Build 11025647097: 0.002%
Covered Lines: 22344
Relevant Lines: 25612

💛 - Coveralls

@heyanuja heyanuja merged commit 2a6bbcd into f24 Sep 25, 2024
1 check passed
@heyanuja heyanuja deleted the anuja-project1 branch October 11, 2024 02:55
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