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

Add the authorization Step for the Application Passwords #96891

Merged
merged 16 commits into from
Dec 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add the action to skip the error on storing the credentials
  • Loading branch information
valterlorran committed Dec 3, 2024
commit 228b6f32f77bfc894ef0abff97eb2b4e74d0f7a2
Original file line number Diff line number Diff line change
@@ -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 ) {
@@ -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;
Original file line number Diff line number Diff line change
@@ -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
@@ -571,10 +571,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,
} );
}
}
}
Loading