Skip to content

Commit

Permalink
Restrict Site Transfer Input to Email Addresses (#97103)
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr authored Dec 9, 2024
1 parent 6cf2241 commit 4390364
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function TeamMembersSiteTransfer( props: Props ) {
}

function onClick( user: Member ) {
props.onClick( user.login );
props.onClick( user.email as string );
}

function renderPerson( user: Member ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ const SiteOwnerTransferEligibility = ( {
checkSiteTransferEligibility( { newSiteOwner: tempSiteOwner } );
};

function onUserClick( userLogin: string ) {
onRecipientChange( userLogin );
checkSiteTransferEligibility( { newSiteOwner: userLogin } );
function onUserClick( userEmail: string ) {
onRecipientChange( userEmail );
checkSiteTransferEligibility( { newSiteOwner: userEmail } );
}

function onRecipientChange( recipient: string ) {
Expand All @@ -102,7 +102,7 @@ const SiteOwnerTransferEligibility = ( {
<form onSubmit={ handleFormSubmit }>
<FormText>
{ translate(
"Ready to transfer {{strong}}%(siteSlug)s{{/strong}} and its associated purchases? Simply enter the new owner's email or WordPress.com username below, or choose an existing user to start the transfer process.",
"Ready to transfer {{strong}}%(siteSlug)s{{/strong}} and its associated purchases? Simply enter the new owner's email below, or choose an existing user to start the transfer process.",
{
args: { siteSlug },
components: { strong: <Strong /> },
Expand All @@ -111,13 +111,13 @@ const SiteOwnerTransferEligibility = ( {
</FormText>

<FormFieldset>
<FormLabel>{ translate( 'Email or WordPress.com username' ) }</FormLabel>
<FormLabel>{ translate( 'Email' ) }</FormLabel>
<FormTextInput
id="recipient"
name="recipient"
value={ tempSiteOwner }
isError={ recipientError }
placeholder="@"
placeholder="[email protected]"
onChange={ ( e: ChangeEvent< HTMLInputElement > ) => onRecipientChange( e.target.value ) }
/>
{ recipientError && (
Expand All @@ -144,7 +144,7 @@ const SiteOwnerTransferEligibility = ( {
<TeamMembersSiteTransfer
search={ tempSiteOwner }
usersQuery={ usersQuery }
onClick={ ( userLogin: string ) => onUserClick( userLogin ) }
onClick={ ( userEmail: string ) => onUserClick( userEmail ) }
/>
) }

Expand Down

0 comments on commit 4390364

Please sign in to comment.