-
Notifications
You must be signed in to change notification settings - Fork 1
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
Visibility option feature within new post #38
Conversation
…nt choose to be anonymous
…rposes (line 52 - line 60)
…own feature line 96 in composer.tpl
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.
I looked through the code and the front end seems to be working. Try to work on creating routes, controller functions and changing the database for sprint 2.
I am currently working on the backend with routes and changing the database! |
@GulnazSerikbay could you help me with fixing the backend of this feature? |
I made some changes in backend as well as adding a small checkbox in the post creation interface for this, it works as expected, but we could change the UI by working on the design of the checkbox/dropdown and make some changes to code structure (I made first-thought changes here) |
… from public to anonymous
…313Q/fall23-nodebb-the-powerpuff-girls into visibility-option-feature
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.
Hey, I noticed you disabled the checks for Postgres and mongo, but I don’t think that is allowed if we want to merge your changes with the main branch. Our implementation has to pass on all database types. However, if tests are passing on Redis and Postgres, there should be only a small change required to pass tests on Mongo as well. Since you were getting an error post type not defined in schema for mongo, try adding the post type field in the yaml files for either post or topic
Thank you @GulnazSerikbay for resolving this issue that we faced in Sprint 1 such as the dropdown not working with the backend. An issue we faced during Sprint 1 and the beginning of Sprint 2 was the front-end dropdown feature. We decided to change the frontend by showcasing a check box rather than a dropdown for simplicity. |
We tested the feature by covering multiple aspects of it. For example, we created tests that would verify that once the user checks the box that the postType would become anonymous. In addition, we created a test to check if the owner of post and topic would change properly (username would be visible only to the user who posted it and anonymous for every other account. |
NOTE: Locally, npm run test is working properly as expected. |
SPRINT 1
Added a new feature within the NodeBB Q&A System which allows the student to submit a question that they have anonymously or publicly. I edited the create.js file to have a postVisibility check, and I also added a line within the .gitignore file to not ignore the changes within composer.tpl file. The composer.tpl file contains the frontend drop down function within the new create post partial.
This resolves Issue #31
Testing: I first created a student account in NodeBB. Once that passed, I clicked on the new topic button in the comments and feedback section. The "Post Visibility" drop-down shows up on the partial successfully and the student can choose to post publicly or privately. However, when I submit the post the username still shows up (which means I have to resolve issues from the backend).
SPRINT 2
Changed the original feature which was a dropdown for the student to choose to post publicly or anonymously. We edited the src/posts/create.js, src/topics/create.js, src/topics/index.js, src/topics/posts.js and src/categories/topics.js. We also configured within the .gitignore, .github/workflows/test.yaml for testing on GitHub, test/api.js for debugging purposes.
Testing: I first created a student account in NodeBB. Then, I go to the "Comments and Feedback" section and click on the "new topic" button to start drafting my question. I write the title and see that there is a checkbox to "Post Anonymously", which I want to do, so I tick the box. Then I complete drafting my question and submit it. Once it's submitted, I see that my post is anonymous. In order to confirm this, I create another student account with different credentials and check if the latest post is anonymous and no username and profile picture show up.