-
Notifications
You must be signed in to change notification settings - Fork 6
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
Article ratings reducers and implementation #98
base: develop
Are you sure you want to change the base?
Article ratings reducers and implementation #98
Conversation
const isLoggedIn = this.isLoggedIn(); | ||
const user = getUserIdFromLocalStorage(); | ||
const { title } = this.props.match.params; | ||
const rating = this.props.userRating.successResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'userRating' is missing in props validation react/prop-types
'userRating.successResponse' is missing in props validation react/prop-types
const { title } = this.props.match.params; | ||
const userId = getUserIdFromLocalStorage(); | ||
if (userId) { | ||
this.props.getUserArticleRating(title); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'getUserArticleRating' is missing in props validation react/prop-types
</Fragment> | ||
); | ||
class ViewArticle extends Component { | ||
isLoggedIn = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLoggedIn should be placed after componentWillMount react/sort-comp
} | ||
|
||
render() { | ||
const { id, ratingIcon, numberofcomments, date, name, rating, disabled } = this.props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'id' is missing in props validation react/prop-types
'numberofcomments' is assigned a value but never used no-unused-vars
articleId: this.props.selectedArticleId, | ||
rating | ||
}; | ||
this.props.createArticleRating(ratingDetails); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'createArticleRating' is missing in props validation react/prop-types
|
||
handleRate = (e, { rating }) => { | ||
const ratingDetails = { | ||
reviewerId: this.props.user, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'user' is missing in props validation react/prop-types
@@ -87,6 +91,7 @@ ReadArticle.propTypes = { | |||
featuredImageUrl: PropTypes.string, | |||
articleAuthor: PropTypes.object, | |||
getArticle: PropTypes.func.isRequired, | |||
getUserArticleRating: PropTypes.func.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'getUserArticleRating' PropType is defined but prop is never used react/no-unused-prop-types
##What does this PR do.
This PR implements the articles rating functionality.
##Tasks to be carried implemented.
-It also ensures that users are not able to rate articles they have not read.
##relevant PT stories
#162414125