Skip to content

Commit

Permalink
Add the action to skip the error on storing the credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
valterlorran committed Dec 3, 2024
1 parent 5ef7f4a commit 0bd4911
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,22 @@ const SiteMigrationApplicationPasswordsAuthorization: Step = function ( { naviga
navigation?.submit?.( { action: 'authorization', authorizationUrl } );
};

const contactMe = () => {
navigation?.submit?.( { action: 'contact-me' } );
};

let notice = undefined;
if ( isStoreApplicationPasswordError ) {
notice = (
<Notice status="is-error" showDismiss={ false }>
{ translate( "We couldn't complete the authorization." ) }
<button
className="button navigation-link step-container__navigation-link has-underline is-borderless site-migration-application-password-authorization__contact-me-button"
type="button"
onClick={ contactMe }
>
{ translate( 'Please contact me.' ) }
</button>
</Notice>
);
} else if ( isAuthorizationRejected ) {
Expand All @@ -78,14 +89,24 @@ const SiteMigrationApplicationPasswordsAuthorization: Step = function ( { naviga
);
}

const sourceDomain = new URL( source ).hostname;

// translators: %(sourceDomain)s is the source domain that is being migrated.
const subHeaderText = translate(
"We're ready to migrate %(sourceDomain)s to WordPress.com. To make sure everything goes smoothly, we need you to authorize us for access in your WordPress admin.",
{
args: {
sourceDomain,
},
}
);

const formattedHeader = ! isLoading ? (
<FormattedHeader
id="site-migration-credentials-header"
headerText={ translate( 'Get ready for blazing fast speeds' ) }
subHeaderAlign="center"
subHeaderText={ translate(
"We're ready to migrate longdomainname.com to WordPress.com. To make sure everything goes smoothly, we need you to authorize us for access in your WordPress admin."
) }
subHeaderText={ subHeaderText }
align="center"
/>
) : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@
}
}
}
.site-migration-application-password-authorization__contact-me-button {
color: var(--color-text-inverted) !important;
margin-left: 0.25em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,10 @@ const siteMigration: Flow = {
// TODO: Implement fallback credentials step.
}

// return navigate( STEPS.SITE_MIGRATION_STARTED.slug, {
// siteId,
// siteSlug,
// } );
return navigate( STEPS.SITE_MIGRATION_STARTED.slug, {
siteId,
siteSlug,
} );
}
}
}
Expand Down

0 comments on commit 0bd4911

Please sign in to comment.