-
Notifications
You must be signed in to change notification settings - Fork 4
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
Backend Code for Displaying "Anonymous User" and No Icon #51
Conversation
Pull Request Test Coverage Report for Build 11263708134Warning: 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 |
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 changes all look good! So glad that you figured out how to pass the flaky test. The front-end display of "anonymous user" looks exactly like what we discussed before. However, I did notice that when I run tests, there are console logs printing your name multiple times. It would be nice if you could comment out the print statements.
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.
Looks good!
Resolves: #15, #38, #40
Files Changed:
hard-coded inside src/posts/create.js
added new function inside public/src/modules/helper.common.js
cleaned up src/topics/create.js
added front-end code in node_modules/nodebb-theme-harmony/templates/partials/topic/post.tpl
Description:
Inside src/posts/create.js, if hard-coded the "anonymous" field to true, then the front-end code inside node_modules/nodebb-theme-harmony/templates/partials/topic/post.tpl would call the anonTrue function and display user name and icon according to the "anonymous" data field value. This anonTrue function is inside the public/src/modules/helper.common.js which will check whether the anonymous field is set to true or not.
If anonymous is hard-coded to true, a anonymous user display will show up and there will be no icon
Else, if anonymous is hard-coded to be false, the regular user id name and icon will be displayed