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

#160609520 create and retrieve comments #26

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

MuhanguziDavid
Copy link
Contributor

@MuhanguziDavid MuhanguziDavid commented Nov 15, 2018

What does this PR do?

It enables users to create and retrieve comments to articles

Description of tasks to be completed?

Currently, a user cannot create or view comments to articles.
This PR adds functionality to allow users to create comments to articles and view the comments to an article.

How should this be manually tested?

  • Run npm install to install all dependencies
  • Run npm start
  • Click the comment icon on an article.
  • If the article has comments, you should be able to see them
  • Type a comment in the field with a placeholder Please add a comment. Click the Save button.
    The created comment should be saved and displayed among the list of comments.

What are the relevant pivotal tracker stories?

#160609520

Any background context you want to add?

N/A

Checklist: I completed these to help reviewers

  • My IDE is configured to follow the ESlint Conventions

  • I have added tests to cover my changes.

  • All new and existing tests passed.

  • My pull request is based on the latest changes of the develop branch.

@MuhanguziDavid MuhanguziDavid changed the title feature(comments): create and retrieve comments #160609520 create and retrieve comments Nov 15, 2018
@coveralls
Copy link

coveralls commented Nov 15, 2018

Pull Request Test Coverage Report for Build 416

  • 59 of 60 (98.33%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 98.417%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/comments/CommentList.js 4 5 80.0%
Totals Coverage Status
Change from base Build 376: 0.02%
Covered Lines: 318
Relevant Lines: 319

💛 - Coveralls

@@ -11,13 +11,15 @@
"enzyme-adapter-react-16": "^1.6.0",
"history": "^4.7.2",
"jwt-decode": "^2.2.0",
"moment": "^2.22.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@MuhanguziDavid Do you need this when you have react-moment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@samuelbwambale , I installed react-moment that package was probably installed as a dependency

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool

.then((response) => {
dispatch(getCommentsSuccess(response.data));
})
.catch(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work @MuhanguziDavid.
This section might need more work though.
Why are you logging out the user?
Might it not be necessary to display that reason to that user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @RonKbS , I am logging out the user because the only way in which an error can occur is if the user's authentication token has expired.
I shall add a toast to display the reason for being logged out to the user.

Copy link
Contributor

@RonKbS RonKbS left a comment

Choose a reason for hiding this comment

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

Checking out the UI and I must say nice work.
We will need to display the article being commented on.
screen shot 2018-11-16 at 10 47 34

@MuhanguziDavid
Copy link
Contributor Author

Thanks for the feedback @RonKbS . I am not able to display the article being commented on because the functionality to display a single article has not yet been merged into develop.

});
});

it('should it should add a comment payload when GET_COMMENTS_SUCCESS is true', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change the wording here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The wording has been changed

- create and retrieve comments

[Delivers #160609520]
Copy link
Collaborator

@samuelbwambale samuelbwambale left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@RonKbS RonKbS left a comment

Choose a reason for hiding this comment

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

LGTM

@dondrzzy dondrzzy merged commit 868d38d into develop Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants