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

Anonymous Feature (Sprint #2) - implementing anonymous field in the backend #28

Open
wants to merge 35 commits into
base: f24
Choose a base branch
from

Conversation

ericlin2
Copy link

@ericlin2 ericlin2 commented Oct 4, 2024

Backend Feature: Implementing the Anonymous Field

Summary
This PR tackles Issue #12, and we attempted to implement a field handling the anonymous nature of a post in the backend, while being connected to the frontend.


Key Changes:

1) Adding anonymous field to frontend post handler function

  • nodebb-plugin-composer-default/static/lib/composer.js)

2) Adding anonymous field to the backend:

  • src/posts/create.js
  • src/posts/data.js
  • src/posts/summary.js
  • src/topics/create.js

3) Adding anonymous field to the schema:

  • public/openapi/components/schemas/PostObject.yaml
  • public/openapi/components/schemas/TopicObject.yaml
  • public/openapi/read/topic/topic_id.yaml
  • public/openapi/write/posts/pid.yaml

Challenges Encountered:

  1. Errors matching up schema with response body
    Screenshot 2024-10-10 at 10 45 09 PM
    Screenshot 2024-10-10 at 10 45 54 PM

Current Status:

Build status: The manual lint fixes are in place, and the code should now comply with the project’s coding standards.
Feature status:

  • The checkbox is present and functional on the frontend
  • Running into test suite errors on schema matching response body (our implementation of the anonymous field in the backend)
    Next Steps: Further examination of what functions we implemented our anonymous field triggered the schema errors.

Current status: The anonymous field is included in the post function handling the frontend UI for drafting posts. This field is able to be connected in the backend. Running into issues with having the backend match with the schema right now.


Testing Instructions:

  1. Checkout the anonymous-feature branch.
  2. Run npm install and ensure the project builds successfully.
  3. Test the anonymous checkbox functionality by toggling it within a draft post
  4. Verify that the code adheres to linting standards

@VeronicaPim VeronicaPim force-pushed the f24 branch 2 times, most recently from bf0fcb8 to 29c75ea Compare October 9, 2024 21:45
@ericlin2 ericlin2 self-assigned this Oct 10, 2024
@ericlin2 ericlin2 changed the title Anonymous Feature - added anonymous to composer data flow Anonymous Feature (Sprint #2) - added anonymous to composer data flow Oct 10, 2024
@ericlin2 ericlin2 changed the title Anonymous Feature (Sprint #2) - added anonymous to composer data flow Anonymous Feature (Sprint #2) - implementing anonymous field in the backend Oct 10, 2024
Copy link

@eunseokk eunseokk left a comment

Choose a reason for hiding this comment

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

This looks good!

Copy link

@VeronicaPim VeronicaPim left a comment

Choose a reason for hiding this comment

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

hi please make sure you are checking your code coverage here.

@ericlin2 ericlin2 added this to the Sprint 2 milestone Oct 11, 2024
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.

4 participants