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

Guided Transfer: Save host details #7534

Merged
merged 26 commits into from
Sep 6, 2016

Conversation

jordwest
Copy link
Contributor

@jordwest jordwest commented Aug 18, 2016

Depends on #7430 Merged

This changes triggers the save host details action (which hits the relevant API endpoint) when the Continue button is pressed on the host details form, then redirects to the checkout.

How to test

  1. Go to My Sites > Settings > Export
  2. Click Purchase a Guided Transfer
  3. Choose a host
  4. Enter some fake details
  5. Click Continue
  6. You should see an error:
    screen shot 2016-09-02 at 12 10 15 pm
  7. If you have a real Bluehost/SiteGround account for testing, enter the details and you should be redirected to the cart containing the Guided Transfer.

Test live: https://calypso.live/?branch=add/guided-transfer/save-host-details

@jordwest
Copy link
Contributor Author

This PR is now complete and ready for review, but it includes and depends on the changes in #7430, so I'll wait until that's merged before changing the status here

@dllh
Copy link
Member

dllh commented Aug 22, 2016

I had a quick test of this, and it redirected to the checkout page as expected. I won't dig much more until #7430 lands and the overlapping code is yanked out of this one.

@jordwest jordwest force-pushed the add/guided-transfer/save-host-details branch from cd83eb0 to d75f8f6 Compare August 23, 2016 04:22
@jordwest
Copy link
Contributor Author

#7430 has now landed, I've rebased this PR and marking it ready for review.

@jordwest jordwest added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Aug 23, 2016
@jordwest jordwest force-pushed the add/guided-transfer/save-host-details branch from 52250b6 to 72e10e9 Compare August 23, 2016 07:41
@jordwest
Copy link
Contributor Author

Rebased again and resolved conflicts introduced in #7270

@dllh
Copy link
Member

dllh commented Aug 23, 2016

I gave this a test, and it works as expected. The code all looks pretty reasonable to me, but I'm not very familiar with some of the things this code uses, so I'd like to get a proper review from a dev who's got fingers in Calypso code every day.

@@ -8,7 +8,7 @@ import { connect } from 'react-redux';
* Internal dependencies
*/
import PostTypeOptions from './post-type-options';
import SpinnerButton from './spinner-button';
import SpinnerButton from 'components/button/spinner-button';
Copy link
Contributor

Choose a reason for hiding this comment

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

Few issues with this change:

Copy link
Contributor Author

@jordwest jordwest Aug 27, 2016

Choose a reason for hiding this comment

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

Moved this into components/spinner-button in 7c08267, and fixed up the className

@jordwest jordwest force-pushed the add/guided-transfer/save-host-details branch 2 times, most recently from 040f9b8 to 2ffb657 Compare August 27, 2016 05:09
@jordwest
Copy link
Contributor Author

jordwest commented Aug 27, 2016

Thanks for the thorough reviews @aduth! I've made most of your suggested changes and responded inline

}

componentWillReceiveProps( nextProps ) {
if ( nextProps.isAwaitingPurchase === true ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What other truthy values are you expecting? We're usually not so explicit about these comparisons. Instead, this is just as effective:

if ( nextProps.isAwaitingPurchase ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 97ebf31

@jordwest jordwest force-pushed the add/guided-transfer/save-host-details branch from d235df2 to 05c6522 Compare September 6, 2016 10:28
@jordwest
Copy link
Contributor Author

jordwest commented Sep 6, 2016

I've just rebased on master and fixed some minor issues (05c6522 and 1c31812).

@rickybanister: I also switched the error notices to appear above the form in d9e05dd.

@aduth: do you feel this needs further review or would you be comfortable giving it the thumbs up?

translate( "We've already confirmed your details. Please contact support if you need to change them." ),
};

const errorText = get(
Copy link
Contributor

Choose a reason for hiding this comment

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

A case to be made for a switch with default here would be that you could avoid the translate call for the default value that you're always making here, since translate is a non-trivial function call. Not worried enough to warrant any change.

@aduth
Copy link
Contributor

aduth commented Sep 6, 2016

No other comments on the code, and the "invalid details" error showed for me as expected in testing. LGTM 👍

@aduth aduth 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 Sep 6, 2016
@jordwest
Copy link
Contributor Author

jordwest commented Sep 6, 2016

Thanks! I swapped out the get for a switch statement in 83fcc50.

@jordwest jordwest merged commit 4e149b2 into master Sep 6, 2016
@jordwest jordwest deleted the add/guided-transfer/save-host-details branch September 6, 2016 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants