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

Visibility option feature within new post #38

Closed
wants to merge 29 commits into from

Conversation

a-khaldi
Copy link
Contributor

@a-khaldi a-khaldi commented Sep 18, 2023

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.

Copy link
Contributor

@Malika1109 Malika1109 left a 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.

@a-khaldi a-khaldi added bug Something isn't working help wanted Extra attention is needed labels Sep 19, 2023
@a-khaldi
Copy link
Contributor Author

Milestones:
The reason why this is not working is due to issues with the backend code, the functionality of the code is not yet working properly.
Screenshot 2023-09-18 at 4 23 16 PM
Screenshot 2023-09-18 at 4 23 23 PM
Screenshot 2023-09-18 at 4 23 33 PM

@a-khaldi
Copy link
Contributor Author

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!

@a-khaldi
Copy link
Contributor Author

@GulnazSerikbay could you help me with fixing the backend of this feature?

@a-khaldi a-khaldi added this to the Sprint 2 milestone Sep 27, 2023
@GulnazSerikbay
Copy link
Contributor

@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)

@GulnazSerikbay GulnazSerikbay removed the help wanted Extra attention is needed label Oct 4, 2023
Copy link
Contributor

@Malika1109 Malika1109 left a 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

@a-khaldi
Copy link
Contributor Author

a-khaldi commented Oct 5, 2023

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.

@a-khaldi
Copy link
Contributor Author

a-khaldi commented Oct 5, 2023

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.

@GulnazSerikbay
Copy link
Contributor

GulnazSerikbay commented Oct 5, 2023

Resolves #46 #31

Changes to frontend are as follows:

  • made a better aligned checkbox 'Post anonymously' in the post creation window:
image
  • added a black tag to the post header
    View for the author of the post:
image View for other students: image
  • post appears as anonymous in the blog page in a list of topics
image

@GulnazSerikbay GulnazSerikbay removed the bug Something isn't working label Oct 5, 2023
@GulnazSerikbay
Copy link
Contributor

NOTE:
We tried to resolve the checks issues (not everything is passing, e.g. mondo-dev, mongo, postgres) by changing the database schema in .yaml files, but we didn't have enough time to finish this up.

Locally, npm run test is working properly as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants