You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dependencies:"Create a toggle button for users to select to be anonymous"
Estimated Effort: 4 hours
Acceptance criteria:
If the user turns the toggle button on, the post submitted will be uploaded with an anonymous tag and default profile.
If the user turns the toggle button off, the post submitted will be uploaded with the signed in user's tag and default profile.
2b Project Updates:
Screenshots of local environment because I could not get the new node_modules changes to work before the deadline via the new instructions:
Issues:
I created a event handler for the action of the user turning the anonymous toggle button on. This function seems to be working based on a lot of console.log tests that I performed to make sure that the returning properties were correct (returns true is the toggle button is on).
The issue I am having is deciding where to call this function. I tried finding a location to call it in the async function post in the same file, however, non of the input data seems to be directly related to the uid, username, or displayname.
Another attempt at connecting the backend to the frontend was in the src/topcs/posts.js file. I set postObj.user.username and postObj.user.displayname to "anonymous", and that correctly displayed an anonymous username when I tried posting something on the forum. I struggled to find a way to connect these statements under and if statement that would only execute under the condition that the anonymous toggle was actually on.
2c Project Updates:
Estimated time effort: I spent over 25 hours trying to get my feature to work in the past 2 weeks for sprint 2.
During sprint 2, I made updates to the api for posts. So if you run the route 'api/v3/posts/{pid}', you will see the additional 'anonymous' attribute that I added. This attribute takes on either a value of 0 or 1, 0 for if the anonymous button is off, and 1 for if the anonymous button is on. Here is a screenshot of the api:
I updated src/topics/posts.js to update the username if the anonymous attribute in a given post was 1.
In nodebb-plugin-composer-default/static/lib/composer.js, I created a handleAnonymous function that creates a boolean 'isAnonymous' variable. If the button is toggled on, the isAnonymous is true, and if the button is toggled off, the isAnonymous is false.
Issues arose when I tried to update this anonymous api attribute when the button was on. In my nodebb-plugin-composer-default/static/lib/composer.js file, I attempted to update this attribute using a 'put' method to the api endpoint, but I was running into errors regarding authorization. Running the commented out code when a topic was posted gave me 403 authorization errors in regards to the 'put' method to send new information to the API. I could not figure out the token.
Ultimately, all the parts are working individually, but I had trouble connecting the backend to the frontend feature. I went to office hours to get help on my task, but did not make much progress in the backend to frontend connection.
Testing issue: There is one more issue with updating the schema. Since I updated the API, the response returns a post object with the attribute 'anonymous'. The tests that still fail, however, refer to the schema not being updated to reflect that. I attempted to update public/openapi/components/schemas/PostObject.yaml as well as public/openapi/write/posts/pid.yaml, but changes to those schema files did not help solve this issue. All other tests pass.
The text was updated successfully, but these errors were encountered:
Dependencies:"Create a toggle button for users to select to be anonymous"
Estimated Effort: 4 hours
Acceptance criteria:
2b Project Updates:
Screenshots of local environment because I could not get the new node_modules changes to work before the deadline via the new instructions:
node_modules/nodebb-plugin-composer-default/static/lib/composer.js:
Issues:
I created a event handler for the action of the user turning the anonymous toggle button on. This function seems to be working based on a lot of console.log tests that I performed to make sure that the returning properties were correct (returns true is the toggle button is on).
The issue I am having is deciding where to call this function. I tried finding a location to call it in the async function post in the same file, however, non of the input data seems to be directly related to the uid, username, or displayname.
Another attempt at connecting the backend to the frontend was in the src/topcs/posts.js file. I set postObj.user.username and postObj.user.displayname to "anonymous", and that correctly displayed an anonymous username when I tried posting something on the forum. I struggled to find a way to connect these statements under and if statement that would only execute under the condition that the anonymous toggle was actually on.
2c Project Updates:
Estimated time effort: I spent over 25 hours trying to get my feature to work in the past 2 weeks for sprint 2.
During sprint 2, I made updates to the api for posts. So if you run the route 'api/v3/posts/{pid}', you will see the additional 'anonymous' attribute that I added. This attribute takes on either a value of 0 or 1, 0 for if the anonymous button is off, and 1 for if the anonymous button is on. Here is a screenshot of the api:
I updated src/topics/posts.js to update the username if the anonymous attribute in a given post was 1.
In nodebb-plugin-composer-default/static/lib/composer.js, I created a handleAnonymous function that creates a boolean 'isAnonymous' variable. If the button is toggled on, the isAnonymous is true, and if the button is toggled off, the isAnonymous is false.
Issues arose when I tried to update this anonymous api attribute when the button was on. In my nodebb-plugin-composer-default/static/lib/composer.js file, I attempted to update this attribute using a 'put' method to the api endpoint, but I was running into errors regarding authorization. Running the commented out code when a topic was posted gave me 403 authorization errors in regards to the 'put' method to send new information to the API. I could not figure out the token.
Ultimately, all the parts are working individually, but I had trouble connecting the backend to the frontend feature. I went to office hours to get help on my task, but did not make much progress in the backend to frontend connection.
Testing issue: There is one more issue with updating the schema. Since I updated the API, the response returns a post object with the attribute 'anonymous'. The tests that still fail, however, refer to the schema not being updated to reflect that. I attempted to update public/openapi/components/schemas/PostObject.yaml as well as public/openapi/write/posts/pid.yaml, but changes to those schema files did not help solve this issue. All other tests pass.
The text was updated successfully, but these errors were encountered: