Feature/Real time updates and feedback alert message after adding new comments #1007
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request aims to enhance the commenting feature by adding real time comment updates and feedback. When user posts a comment they can see the changes in real time without refreshing the page. And, they will be provided with a alert message indicating the success or failure of the action.
CommentBox
component used to pass onlycomment_ids
into theComment
components where the comments were being fetched. Now,CommentBox
fetches the comments and passes it intoComment.jsx
which only renders them further.state.tutorialPage.comment.data
used to hold all the comments and replies in the same state andstate.tutorialPage.comment.replies
contained only the id of replies which where being fetched insideComment
component. Now, comment are put intostate.tutorialPage.comment.data
and replies are put intostate.tutorialPage.comment.replies
.addComment
function intutorialPageActions.js
. Now, comments are being added usingaddComment
and replies are added usingaddReply
.actionTypes.js
for tracking the start, success and failure of theaddReply
action.addReply
successfully adds a reply to a comment there is a handler incommentReducer.js
which first gets the comment fromstate.tutorialPage.comment.replies
and adds a new reply into that array.AddCommentFeedback
which notifies the user of the success and failure of the action.Related Issue
Fixes/Implementation #996
Motivation and Context
Commenting feature is now enhanced greatly as the inconvenience of refreshing the page is eliminated and user is notified of the result of adding new comments.
How Has This Been Tested?
The changes were test locally on Brave browser.
Development Environment
Screenshots or GIF (In case of UI changes):
issue_996_pr_demo.mp4
Types of changes
Checklist: