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

Specified viewer groups for posts added (Do Not Accept!) #46

Open
wants to merge 1 commit into
base: sprint2-main
Choose a base branch
from

Conversation

sofian-syed
Copy link

@sofian-syed sofian-syed commented Oct 11, 2024

IMG_2544
This PR addresses issue #20, authored by Alanna. This issue required posts to only be visible to users in specified groups based on the visibility preferences set by the student. The user should be able to specify viewers with the button attached.

File changes made:
nodebb-f24-team-sweepers/src/posts/create.js: Added field to post by student which represents visibility user group.
nodebb-f24-team-sweepers/src/posts/topics.js: Modified getPostsFromSet file to only make posts with correct visibility level for current user to be rendered.
nodebb-f24-team-sweepers/test/topics-viewers.js: Automated test suite for modifications and additions to above two files.

Please do not accept this PR as more work is required. Currently, the first set of tests within topics-viewers.js are passing meaning the db is correctly being manipulated with the correct post visibility field. However, the tests for rendering the correct posts based off user permissions are not yet passing.

Throughout the sprint, I faced challenges ensuring visibility preferences were correctly stored and reflected in the test suite. I learned to store post visibility levels by adding/editing database fields. The major obstacle leading to the delay in development was integrating the visibility logic with post rendering as posts were not filtering correctly for each group. Debugging led me to dive deeper into the database schema and user permission filtering logic. I urge anyone attempting to debug this to look at database get/set operations, user permission groups, and filtering logic.

@sofian-syed sofian-syed changed the base branch from f24 to sprint2-main October 11, 2024 01:31
@sofian-syed sofian-syed added the bug Something isn't working label Oct 11, 2024
@sofian-syed sofian-syed changed the title DO NOT ACCEPT! Specified viewer groups for posts added. Specified viewer groups for posts added (Do Not Accept!) Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants