forked from CMU-17313Q/cmu-17313q-f24-nodebb-f24-NodeBB
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement automated content filtering (User Story #1) #47
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file will be added from the user-guide branch
mohamed-elzeni
added
enhancement
New feature or request
frontend
main code is written in frontend
backend
main code is written in backend
High impact
Features that have a high impact on the application
Moderate effort
Features that need moderate effort to implement
Test
This tests features that were implemented
labels
Oct 20, 2024
Pull Request Test Coverage Report for Build 11428259809Details
💛 - Coveralls |
lhitmi
approved these changes
Oct 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks very clear!
This was
linked to
issues
Oct 20, 2024
akobaidan
approved these changes
Oct 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code looks clear and effective.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend
main code is written in backend
enhancement
New feature or request
High impact
Features that have a high impact on the application
Moderate effort
Features that need moderate effort to implement
Test
This tests features that were implemented
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.
This adds an automated content filtering system to prevent users from creating posts that contain inappropriate words.
This is done by importing a predefined list of inappropriate words from the
inappropriate-words.json
file, where the module insrc/filters.js
has been created to perform that. Then, this module exposes thegetInappropriateWords
method to be used in loading these words when needed for filtering. A function was created for checking a given text against the list. And the text of any post or reply that the user attempts to post is first given to this function, and if it flags it as inappropriate, the user is given a warning message and prevented from posting.This also adds comprehensive automated tests. Testing for this feature is explained in more detail in
UserGuide.md
.The following files were added:
inappropriate-words.json
src/filters.js
And the following files were modified:
src/topics/create.js
test/posts.js
This resolves #2, #3, and #4, fully completing User Story 1 and resolving #18.