Skip to content

#164829334 follow/unfollow users#31

Open
ipaullly wants to merge 21 commits intodevelopfrom
ft-follow-user-164829334
Open

#164829334 follow/unfollow users#31
ipaullly wants to merge 21 commits intodevelopfrom
ft-follow-user-164829334

Conversation

@ipaullly
Copy link
Contributor

What does this PR do?

  • Implements part of a user interface for the profile pages of the Author's Haven platform. a user can view his followers or the people he follows through links in their profile pages. users can access other peoples profiles and follow or unfollow other users.

Description of Tasks to be completed?

  • Implement follow/unfollow functionality in the User Interface.
  • Users should be able to access links to view pages showing their followers and people they follow.

How should this be manually tested?

What are the relevant Pivotal Tracker Stories?

https://www.pivotaltracker.com/n/projects/2321086/stories/164829334

updateMessage: false,
};

Choose a reason for hiding this comment

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

Trailing spaces not allowed no-trailing-spaces

};

case ProfileAction.FETCH_FOLLOWERS:
console.log(action.followerCount);

Choose a reason for hiding this comment

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

Expected indentation of 6 spaces but found 4 indent
Unexpected console statement no-console

return axios.put(
`${configUrls.root}/profile/${user.username}/edit/`,
{ profile: { name: name, user_bio: bio } },
config)

Choose a reason for hiding this comment

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

Expected a newline before ')' function-paren-newline

return axios.put('http://127.0.0.1:8000/api/profile/Kyppy/edit/', { profile: { name: name, user_bio: bio } })
return axios.put(
`${configUrls.root}/profile/${user.username}/edit/`,
{ profile: { name: name, user_bio: bio } },

Choose a reason for hiding this comment

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

Expected property shorthand object-shorthand

export const fetchName = currentUserProf => (dispatch) => {
return axios.get(
`${configUrls.root}/profiles/${currentUserProf}/`,
config)

Choose a reason for hiding this comment

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

Expected a newline before ')' function-paren-newline

};

export const getFollowings = () => {
return (dispatch) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};
};

export const getFollowings = () => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};

export const getFollowers = () => {
return (dispatch) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};
};

export const getFollowers = () => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};

export const unFollow = (userName) => {
return (dispatch) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

@kihuha kihuha temporarily deployed to ah-the-answer-frontend-s-pr-31 May 19, 2019 16:43 Inactive
@kihuha kihuha temporarily deployed to ah-the-answer-frontend-s-pr-31 May 19, 2019 16:50 Inactive
};
};

export const unFollow = (userName) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};

export const checkFollow = (userName) => {
return (dispatch) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};
};

export const checkFollow = (userName) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

};

export const follow = (userName) => {
return (dispatch) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

headers: authHeader(),
};

export const follow = (userName) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

this.props.fetchFollowers();
const {
fetchName,
fetchBio,

Choose a reason for hiding this comment

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

'fetchBio' is already declared in the upper scope no-shadow
'fetchBio' is missing in props validation react/prop-types

this.props.fetchFollows();
this.props.fetchFollowers();
const {
fetchName,

Choose a reason for hiding this comment

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

'fetchName' is already declared in the upper scope no-shadow
'fetchName' is missing in props validation react/prop-types

profileprops: state.profile,
});

export default connect(mapStateToProps)(ConnectedSocialFollowing); No newline at end of file

Choose a reason for hiding this comment

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

Newline required at end of file but not found eol-last


componentWillReceiveProps(nextProps) {
// this.props.getFollowers(this.props.userName);
this.setState({ followers: nextProps.profileprops.followers });

Choose a reason for hiding this comment

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

'profileprops' is missing in props validation react/prop-types
'profileprops.followers' is missing in props validation react/prop-types

}

componentDidMount() {
this.setState({ followers: this.props.followers });

Choose a reason for hiding this comment

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

'followers' is missing in props validation react/prop-types
Do not use setState in componentDidMount react/no-did-mount-set-state

@kihuha kihuha temporarily deployed to ah-the-answer-frontend-s-pr-31 May 20, 2019 07:28 Inactive
import React, { Component } from 'react';
import { connect } from 'react-redux';

export class ConnectedSocialFollowing extends Component {

Choose a reason for hiding this comment

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

Block must not be padded by blank lines padded-blocks

const userName = userData.username;
this.props.resetProfileUpdate();
this.props.history.push('/profile');
this.props.history.push(`/profile/${userName}`);

Choose a reason for hiding this comment

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

'history' is missing in props validation react/prop-types
'history.push' is missing in props validation react/prop-types

</h3>
<h5 className="text-primary">
@{secondName || "Username"}
@{userName || "Username"}

Choose a reason for hiding this comment

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

Strings must use singlequote quotes

const userDetails = authUser();

const NameTag = ({firstName, secondName}) => (
const NameTag = ({ firstName, userName, followers }) => (

Choose a reason for hiding this comment

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

'firstName' is missing in props validation react/prop-types
'followers' is missing in props validation react/prop-types
'userName' is missing in props validation react/prop-types

const {
fetchName,
fetchBio,
} = this.props

Choose a reason for hiding this comment

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

Missing semicolon semi

followers: state.follows.followers,
});

const mapDispatchToProps = (dispatch) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the => arrow-body-style

<ul className="list-group list-group-flush">
{ followers && followers.map((follower) => {
return (
<Link to={`/profile/${follower}`}>

Choose a reason for hiding this comment

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

The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid

<div className="col-lg-8 col-md-8 col-sm-12 p-0">
<h2 className="text-center mb-4 sticky-top bg-white p-2">Followers</h2>
<ul className="list-group list-group-flush">
{ followers && followers.map((follower) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style


componentDidMount() {
const {
getFollowers,

Choose a reason for hiding this comment

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

'getFollowers' is already declared in the upper scope no-shadow
'getFollowers' is missing in props validation react/prop-types

checkFollow: userName => dispatch(checkFollow(userName)),
fetchFollowers: userName => dispatch(fetchFollowers(userName)),
});
export default connect(mapStateToProps, mapDispatchToProps)(FollowButton) No newline at end of file

Choose a reason for hiding this comment

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

Missing semicolon semi
Newline required at end of file but not found eol-last

@ipaullly ipaullly changed the title Ft follow user 164829334 #164829334 follow/unfollow users May 20, 2019
@kihuha kihuha temporarily deployed to ah-the-answer-frontend-s-pr-31 May 20, 2019 07:34 Inactive
userName: PropTypes.string,
};

const mapStateToProps = (state, ownProps) => ({

Choose a reason for hiding this comment

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

Trailing spaces not allowed no-trailing-spaces

follow: PropTypes.func,
unFollow: PropTypes.func,
followStatus: PropTypes.bool,
userName: PropTypes.string,

Choose a reason for hiding this comment

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

propType "userName" is not required, but has no corresponding defaultProp declaration react/require-default-props

FollowButton.propTypes = {
follow: PropTypes.func,
unFollow: PropTypes.func,
followStatus: PropTypes.bool,

Choose a reason for hiding this comment

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

'followStatus' PropType is defined but prop is never used react/no-unused-prop-types
propType "followStatus" is not required, but has no corresponding defaultProp declaration react/require-default-props


FollowButton.propTypes = {
follow: PropTypes.func,
unFollow: PropTypes.func,

Choose a reason for hiding this comment

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

propType "unFollow" is not required, but has no corresponding defaultProp declaration react/require-default-props

}

FollowButton.propTypes = {
follow: PropTypes.func,

Choose a reason for hiding this comment

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

propType "follow" is not required, but has no corresponding defaultProp declaration react/require-default-props

}

handleClick = () => {
const { follow, unFollow } = this.props;

Choose a reason for hiding this comment

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

'follow' is already declared in the upper scope no-shadow
'unFollow' is already declared in the upper scope no-shadow


componentWillReceiveProps() {
this.setState({
followStatus: this.props.checkFollowResponse,

Choose a reason for hiding this comment

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

'checkFollowResponse' is missing in props validation react/prop-types


componentDidMount() {
this.props.checkFollow(this.props.userName.userName);
this.props.fetchFollowers(this.props.userName.userName)

Choose a reason for hiding this comment

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

'fetchFollowers' is missing in props validation react/prop-types
Missing semicolon semi

}

componentDidMount() {
this.props.checkFollow(this.props.userName.userName);

Choose a reason for hiding this comment

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

'checkFollow' is missing in props validation react/prop-types

import { follow, unFollow, checkFollow } from '../../store/actions/followActions';
import { fetchFollowers } from '../../store/actions/profileActions';

export class FollowButton extends Component {

Choose a reason for hiding this comment

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

Block must not be padded by blank lines padded-blocks

@kihuha kihuha temporarily deployed to ah-the-answer-frontend-s-pr-31 May 20, 2019 07:48 Inactive
@kihuha kihuha temporarily deployed to ah-the-answer-frontend-s-pr-31 May 20, 2019 11:31 Inactive
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.

3 participants