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

State: Move followers to redux #5248

Merged
merged 3 commits into from
May 27, 2016
Merged

Conversation

roccotripaldi
Copy link
Member

@roccotripaldi roccotripaldi commented May 5, 2016

Moves followers to the redux state. See #5046

This PR creates a branch in the redux tree for followers. It does NOT yet make use of this data in any UI components. A separate PR will handle a queryFollowers component to replace the current Flux implementation.

To test:

  • check out this branch and run npm run test and ensure all follower tests are passing
  • protip: in state/followers/test/reducer.js, state/followers/test/selectors.js, and state/followers/test/utils.js change the top level describe() to describe.only() to run just the follower tests

Check for regressions
Because I made a small change to a WPCOM api method, ensure that removing people still works. Select a site, go to People, select a Team member or Follower, and ensure that you can remove them from the site.

cc: @ebinnion @lezama

@roccotripaldi roccotripaldi added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. People Management State labels May 5, 2016
@roccotripaldi roccotripaldi force-pushed the move-people-data-to-redux branch from 9e24f8e to dc2c905 Compare May 5, 2016 20:41
@jordwest
Copy link
Contributor

jordwest commented May 23, 2016

This may need a rebase, I'm seeing a lot of persistent redux schema errors in the browser console.

Otherwise the included tests are working for me 👍

export const FOLLOWER_REMOVE_REQUEST = 'FOLLOWER_REMOVE_REQUEST';
export const FOLLOWER_REMOVE_ERROR = 'FOLLOWER_REMOVE_ERROR';
export const FOLLOWER_REMOVE_SUCCESS = 'FOLLOWER_REMOVE_SUCCESS';
export const FOLLOWERS_RECEIVE = 'FOLLOWERS_REQUEST_RECEIVE';
Copy link
Contributor

@jordwest jordwest May 23, 2016

Choose a reason for hiding this comment

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

Should this be:

-export const FOLLOWERS_RECEIVE = 'FOLLOWERS_REQUEST_RECEIVE';
+export const FOLLOWERS_REQUEST_RECEIVE = 'FOLLOWERS_REQUEST_RECEIVE';

@roccotripaldi roccotripaldi force-pushed the move-people-data-to-redux branch from dc2c905 to c94e13c Compare May 23, 2016 13:05
@roccotripaldi
Copy link
Member Author

Thanks for the review @jordwest ! I pushed a commit to address your helpful feedback.

removeFollower( siteId, follower ) {
return ( dispatch ) => {
debug( 'removing follower', follower, siteId );
// TODO: replace REMOVE_FOLLOWER with FOLLOWER_REMOVE
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this TODO can also be removed

@jordwest
Copy link
Contributor

Looks good! 🚢

@jordwest jordwest added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 25, 2016
@roccotripaldi roccotripaldi force-pushed the move-people-data-to-redux branch from 3d843f6 to 836aa88 Compare May 27, 2016 16:23
This PR creates a folder in 'client/state' which will eventually replace the
Flux implementation in 'client/lib/followers' with a Redux implementation.

The Redux data is not yet being used anywhere; that will happen in an other PR
that implements a `queryFollowers` component.

I wrote a few tests, mostly to help ensure that the data is being properly stored
in the tree.
`queries` will now contain `ids`, `total`, and `lastPage` as opposed
to having separate closures for `total` and `lastPage`.

This makes it easier to update totals when a follower is removed from
the site.
Addressing feedback from @jordwest
- improve syntax, remove TODOs
@roccotripaldi roccotripaldi force-pushed the move-people-data-to-redux branch from 836aa88 to 4d01a32 Compare May 27, 2016 16:23
@roccotripaldi roccotripaldi merged commit f8d5123 into master May 27, 2016
@lancewillett lancewillett deleted the move-people-data-to-redux branch June 1, 2016 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants