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: Add SiteGround host details #7430

Merged
merged 9 commits into from Aug 23, 2016

Conversation

jordwest
Copy link
Contributor

@jordwest jordwest commented Aug 12, 2016

This refactors the Guided Transfer account-info.jsx to support different host details forms for different hosts and updates the form for SiteGround.

Before

SiteGround Bluehost
screen shot 2016-08-17 at 7 34 40 pm screen shot 2016-08-17 at 7 34 36 pm

After

SiteGround Bluehost
screen shot 2016-08-17 at 7 32 39 pm screen shot 2016-08-17 at 7 31 08 pm

Bluehost requires a username and password, while SiteGround requires a username and email address.

There is some duplication in the Bluehost and SiteGround components, but by moving the common fields to fields.jsx I think this finds a good balance between reusability and flexibility to alter the forms for different host requirements.

To come in a future PR will be the destination site URL. Destination URL field added in 77ea136

Test live: https://calypso.live/?branch=add/guided-transfer/siteground-credentials

@jordwest jordwest force-pushed the add/guided-transfer/siteground-credentials branch 2 times, most recently from 285de85 to 77ea136 Compare August 17, 2016 09:27
@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 17, 2016
}
}

Bluehost.propTypes = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal but just wondering why this doesn't appear inside the class statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, now that we have ES7+ property initializers, I've moved back it into the class in 84dd99046f7bb892ee896e17a8a1c9f0df80f40b.

Previously, setting it outside the class was the only way to set the PropTypes on the class when using ES6 style classes instead of React.createClass.

@jordwest jordwest force-pushed the add/guided-transfer/siteground-credentials branch 2 times, most recently from 82b3c0e to 84dd990 Compare August 17, 2016 23:58
@jordwest
Copy link
Contributor Author

Thanks for the reviews @omarjackman. I've made a few changes and left inline comments

<DestinationURL
value={ fieldValues.wporg_url }
onChange={ onFieldChange( 'wporg_url' ) }
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

To trail the /> or not to trail it. The're a bit inconsistent in the code above. I personally like the format

<SomeComponent
    prop1="prop"
    prop2="prop" />

@omarjackman
Copy link
Contributor

@jordwest I added some more review and suggested not using state in preference for refs.

@jordwest jordwest force-pushed the add/guided-transfer/siteground-credentials branch from 84dd990 to 695efbd Compare August 19, 2016 03:11
@jordwest
Copy link
Contributor Author

Thanks @omarjackman, I've fixed up the bits and pieces and left a comment about using state vs refs

@omarjackman
Copy link
Contributor

@mtias or @aduth We've been going back and forth about using state vs redux vs refs. I'd like an outside opinion if possible just for my own sanity. Can either of you weigh in? 😄

@dllh
Copy link
Member

dllh commented Aug 22, 2016

It's not clear for an external reviewer how to test this. If we want that third opinion, we should update with clear testing steps. That said, I feel like the review here has served its purpose, forcing conscientious consideration of code that raised a pale yellow flag on the part of a reviewer. I'm ok with shipping this as-is and looping back re state/ref if we get a strongly held third opinion that we should update it. @omarjackman any objection to that approach? Would you otherwise offer a 🚢 if not for the uncertainty around state/refs?

@omarjackman
Copy link
Contributor

LGTM, I've got no objections.

@omarjackman
Copy link
Contributor

lets 🚢

This refactors account-info.jsx to support different host details forms and adds a form for SiteGround.
@jordwest jordwest force-pushed the add/guided-transfer/siteground-credentials branch from 89456df to 8d3085f Compare August 23, 2016 03:38
Without this, a warning appears as the
fields go from uncontrolled to controlled.
@jordwest jordwest merged commit 885c20e into master Aug 23, 2016
@jordwest jordwest deleted the add/guided-transfer/siteground-credentials branch August 23, 2016 04:15
@jordwest jordwest removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 23, 2016
@@ -29,7 +29,7 @@ export const Username = localize( props =>
} ) }</FormLabel>
<FormTextInput
id="username"
value={ props.value }
value={ props.value || '' }
Copy link
Member

Choose a reason for hiding this comment

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

This seems like it should be the default value for the prop?

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.

None yet

5 participants