-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auth: Run codemods; use enzyme, remove mixin injection from tests (#1…
…8472) * Auth: Prettify login.jsx * Auth: Run i18n codemod on login.jsx * Auth: Run react-create-class codemod on login.jsx * Auth: Prettify login.jsx * Auth: Simplify login.jsx * Auth: Named export for un-localized Login component * Framework: Upgrade enzyme to 2.9.1 2.5.0 supports passing callbacks to `setState`, which we require for `client/auth/test/login`. Furthermore, there's a fix in 2.6.0 that's required for this to actually work (enzymejs/enzyme#490) Not updating to >=3.0.0 yet since chai-expect isn't compatible (yet). Changelog: https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md#252-november-9-2016 * Auth: Simplify FormTextInput ref (focus) * Auth: Use enzyme to test login.jsx * Auth: Remove obsolete refs from login.jsx (These were only used by tests.) * Auth: Move SelfHostedInstructions and LostPassword to separate files
- Loading branch information
Showing
6 changed files
with
250 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import { localize } from 'i18n-calypso'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { addLocaleToWpcomUrl, getLocaleSlug } from 'lib/i18n-utils'; | ||
|
||
const LostPassword = ( { translate } ) => { | ||
const url = addLocaleToWpcomUrl( | ||
'https://wordpress.com/wp-login.php?action=lostpassword', | ||
getLocaleSlug() | ||
); | ||
return ( | ||
<p className="auth__lost-password"> | ||
<a href={ url } target="_blank" rel="noopener noreferrer"> | ||
{ translate( 'Lost your password?' ) } | ||
</a> | ||
</p> | ||
); | ||
}; | ||
|
||
export default localize( LostPassword ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import { localize } from 'i18n-calypso'; | ||
import Gridicon from 'gridicons'; | ||
|
||
const SelfHostedInstructions = ( { onClickClose, translate } ) => ( | ||
<div className="auth__self-hosted-instructions"> | ||
<a href="#" onClick={ onClickClose } className="auth__self-hosted-instructions-close"> | ||
<Gridicon icon="cross" size={ 24 } /> | ||
</a> | ||
|
||
<h2>{ translate( 'Add self-hosted site' ) }</h2> | ||
<p> | ||
{ translate( | ||
'By default when you sign into the WordPress.com app, you can edit blogs and sites hosted at WordPress.com' | ||
) } | ||
</p> | ||
<p> | ||
{ translate( | ||
"If you'd like to edit your self-hosted WordPress blog or site, you can do that by following these instructions:" | ||
) } | ||
</p> | ||
|
||
<ol> | ||
<li> | ||
<strong>{ translate( 'Install the Jetpack plugin.' ) }</strong> | ||
<br /> | ||
<a href="http://jetpack.me/install/"> | ||
{ translate( 'Please follow these instructions to install Jetpack' ) } | ||
</a>. | ||
</li> | ||
<li>{ translate( 'Connect Jetpack to WordPress.com.' ) }</li> | ||
<li> | ||
{ translate( | ||
'Now you can sign in to the app using the WordPress.com account Jetpack is connected to, ' + | ||
'and you can find your self-hosted site under the "My Sites" section.' | ||
) } | ||
</li> | ||
</ol> | ||
</div> | ||
); | ||
|
||
export default localize( SelfHostedInstructions ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.