-
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
Added feature that adds a flag icon to all replies that contain curse words #15
Conversation
This branch had several minor lint errors such as incorrect usage of double quotes and missing/including trailing commas and spaced.
Overall code LGTM! A few things about the PR description:
Some specific feedback on your description:
|
Looks good! Code is clear and easy to understand. The changes to the PR made it much easier to read and the commit messages are very clear and descriptive. |
Pull Request Test Coverage Report for Build 13247395746Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Context:
The current model is to treat thread owners as teachers and repliers as students. Therefore, it is important that teachers have tools to moderate their threads. A simple tool to accomplish this is a flagging feature on inappropriate content. This feature is able to analyze any new reply in a thread and test weather or not contains any banned words. Similarly, students shouldn't be able to update their messages to circumvent the flag so replies are rescanned on edit. Lastly, the teacher needs some way to recognize any flagged messages so an icon gets added to all flagged replies. Lastly, replies that are made as threads both avoid the flag feature (as they are in a new thread) but also undermine the priority model. Therefore, this feature has been removed. Together this creates a useful tool for teachers in moderating their students.
Description:
The content of every new post is run through a small script that checks if any single word in the post is a curse word. The contentFlag attribute is added and set to true on any post found to contain one of these words. Whenever the content is changed this script is run again and the attribute updated. A small orange flag icon is added to all replies that have their contentFlag attribute set to true. The reply as topic feature button was removed from the front end. Functions that extend functionality to the button were also removed.
Major Changes:
File Changes:
src/posts/flagContent.js:
src/topics/create.js:
src/posts/create.js
src/posts/edit.js:
nodebb-theme-harmony/templates/partials/topic/reply-button.tpl:
public/src/client/topic/postTools.js:
nodebb-theme-harmony/templates/partials/topic/post.tpl:
Testing:
Testing was completed through the coverage suit and lint tests as well as some manual testing locally by creating and editing replies both with and without banned words. Users can simulate this by creating a reply to a thread with a curse word such as the F word.
Screenshot of Feature:

Resolves #8 and all of its sub issues (#13 & #14)