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

Backend Code for Displaying "Anonymous User" and No Icon #51

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

J0nathanLai
Copy link

@J0nathanLai J0nathanLai commented Oct 9, 2024

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
Screenshot 2024-10-09 at 12 02 49 AM

Else, if anonymous is hard-coded to be false, the regular user id name and icon will be displayed
Screenshot 2024-10-09 at 12 03 40 AM

@J0nathanLai J0nathanLai added this to the Sprint 2 milestone Oct 9, 2024
@J0nathanLai J0nathanLai self-assigned this Oct 9, 2024
@coveralls
Copy link

coveralls commented Oct 9, 2024

Pull Request Test Coverage Report for Build 11263708134

Warning: 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

  • 2 of 3 (66.67%) changed or added relevant lines in 3 files are covered.
  • 12 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.01%) to 82.676%

Changes Missing Coverage Covered Lines Changed/Added Lines %
public/src/modules/helpers.common.js 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/user/approval.js 3 87.61%
src/routes/index.js 9 85.53%
Totals Coverage Status
Change from base Build 11113198837: -0.01%
Covered Lines: 22331
Relevant Lines: 25591

💛 - Coveralls

Copy link

@sophiefeng18 sophiefeng18 left a 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.
Screenshot 2024-10-09 at 12 27 31 AM

@anna-mat anna-mat added the enhancement New feature or request label Oct 9, 2024
Copy link

@sophiefeng18 sophiefeng18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@J0nathanLai J0nathanLai merged commit 352ee45 into CMU-313:f24 Oct 9, 2024
1 check passed
@J0nathanLai J0nathanLai changed the title Displays "Anonymous User" and No Icon when Data Field is Set to True Backend Code for Displaying "Anonymous User" and No Icon when Data Field is Set to True Oct 9, 2024
@J0nathanLai J0nathanLai changed the title Backend Code for Displaying "Anonymous User" and No Icon when Data Field is Set to True Backend Code for Displaying "Anonymous User" and No Icon Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants