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

Remove legacy Jetpack + Woo onboarding flow and replace with Woo JPC flow #99558

Merged
merged 14 commits into from
Feb 12, 2025
Merged
27 changes: 0 additions & 27 deletions client/blocks/login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class Login extends Component {
isLinking: PropTypes.bool,
isJetpack: PropTypes.bool.isRequired,
isWhiteLogin: PropTypes.bool.isRequired,
isJetpackWooCommerceFlow: PropTypes.bool.isRequired,
isFromAkismet: PropTypes.bool,
isFromMigrationPlugin: PropTypes.bool,
isFromAutomatticForAgenciesPlugin: PropTypes.bool,
Expand Down Expand Up @@ -115,7 +114,6 @@ class Login extends Component {
static defaultProps = {
isJetpack: false,
isWhiteLogin: false,
isJetpackWooCommerceFlow: false,
};

componentDidMount() {
Expand Down Expand Up @@ -191,7 +189,6 @@ class Login extends Component {
showContinueAsUser = () => {
const {
isJetpack,
isJetpackWooCommerceFlow,
oauth2Client,
privateSite,
socialConnect,
Expand All @@ -210,7 +207,6 @@ class Login extends Component {
! privateSite &&
// Show the continue as user flow WooCommerce and Blaze Pro but not for other OAuth2 clients
! ( oauth2Client && ! isWCCOM && ! isBlazePro ) &&
! isJetpackWooCommerceFlow &&
! isJetpack &&
! fromSite &&
! twoFactorEnabled &&
Expand Down Expand Up @@ -352,7 +348,6 @@ class Login extends Component {
isGravPoweredClient,
isGravPoweredLoginPage,
isJetpack,
isJetpackWooCommerceFlow,
isManualRenewalImmediateLoginAttempt,
isP2Login,
isSignupExistingAccount,
Expand Down Expand Up @@ -617,26 +612,6 @@ class Login extends Component {
}
preHeader = null;
postHeader = <p className="login__header-subtitle">{ subtitle }</p>;
} else if ( isJetpackWooCommerceFlow ) {
headerText = translate( 'Log in to your WordPress.com account' );
preHeader = (
<div className="login__jetpack-logo">
<AsyncLoad
require="calypso/components/jetpack-header"
placeholder={ null }
partnerSlug={ this.props.partnerSlug }
isWooOnboarding
width={ 200 }
/>
</div>
);
postHeader = (
<p className="login__header-subtitle">
{ translate(
'Your account will enable you to start using the features and benefits offered by Jetpack & WooCommerce Services.'
) }
</p>
);
} else if ( isFromMigrationPlugin ) {
headerText = translate( 'Log in to your account' );
} else if ( isJetpack ) {
Expand Down Expand Up @@ -1059,8 +1034,6 @@ export default connect(
'automattic-for-agencies-client' ===
new URLSearchParams( getRedirectToOriginal( state )?.split( '?' )[ 1 ] ).get( 'from' ),
isJetpackWooDnaFlow: wooDnaConfig( getCurrentQueryArguments( state ) ).isWooDnaFlow(),
isJetpackWooCommerceFlow:
'woocommerce-onboarding' === get( getCurrentQueryArguments( state ), 'from' ),
isWooJPC: isWooJPCFlow( state ),
isWCCOM: getIsWCCOM( state ),
isWoo: getIsWoo( state ),
Expand Down
31 changes: 4 additions & 27 deletions client/blocks/login/login-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,8 @@ export class LoginForm extends Component {
};

recordWooCommerceLoginTracks( method ) {
const { isJetpackWooCommerceFlow, isWoo, wccomFrom } = this.props;
if ( isJetpackWooCommerceFlow ) {
this.props.recordTracksEvent( 'wcadmin_storeprofiler_login_jetpack_account', {
login_method: method,
} );
} else if ( isWoo && 'cart' === wccomFrom ) {
const { isWoo, wccomFrom } = this.props;
if ( isWoo && 'cart' === wccomFrom ) {
this.props.recordTracksEvent( 'wcadmin_storeprofiler_payment_login', {
login_method: method,
} );
Expand Down Expand Up @@ -644,13 +640,7 @@ export class LoginForm extends Component {
};

getMagicLoginPageLink() {
if (
! canDoMagicLogin(
this.props.twoFactorAuthType,
this.props.oauth2Client,
this.props.isJetpackWooCommerceFlow
)
) {
if ( ! canDoMagicLogin( this.props.twoFactorAuthType, this.props.oauth2Client ) ) {
return null;
}

Expand All @@ -667,13 +657,7 @@ export class LoginForm extends Component {
}

getQrLoginLink() {
if (
! canDoMagicLogin(
this.props.twoFactorAuthType,
this.props.oauth2Client,
this.props.isJetpackWooCommerceFlow
)
) {
if ( ! canDoMagicLogin( this.props.twoFactorAuthType, this.props.oauth2Client ) ) {
return null;
}

Expand Down Expand Up @@ -792,7 +776,6 @@ export class LoginForm extends Component {
oauth2Client,
requestError,
socialAccountIsLinking: linkingSocialUser,
isJetpackWooCommerceFlow,
isP2Login,
isJetpack,
isJetpackWooDnaFlow,
Expand Down Expand Up @@ -878,10 +861,6 @@ export class LoginForm extends Component {
) : null;
}

if ( isJetpackWooCommerceFlow ) {
return this.renderWooCommerce( { socialToS } );
}

if ( isJetpackWooDnaFlow ) {
return this.renderWooCommerce( {
showSocialLogin: !! accountType, // Only show the social buttons after the user entered an email.
Expand Down Expand Up @@ -1176,8 +1155,6 @@ export default connect(
oauth2Client: getCurrentOAuth2Client( state ),
isFromAutomatticForAgenciesPlugin:
'automattic-for-agencies-client' === get( getCurrentQueryArguments( state ), 'from' ),
isJetpackWooCommerceFlow:
'woocommerce-onboarding' === get( getCurrentQueryArguments( state ), 'from' ),
isJetpackWooDnaFlow: wooDnaConfig( getCurrentQueryArguments( state ) ).isWooDnaFlow(),
isWooJPC: isWooJPCFlow( state ),
isWoo: getIsWoo( state ),
Expand Down
3 changes: 1 addition & 2 deletions client/blocks/login/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

$breakpoint-mobile: 782px; //Mobile size.

.layout:not(.is-jetpack-woocommerce-flow):not(.is-jetpack-woo-dna-flow):not(.is-wccom-oauth-flow):not(.is-woocommerce-core-profiler-flow) {
.layout:not(.is-jetpack-woo-dna-flow):not(.is-wccom-oauth-flow):not(.is-woocommerce-core-profiler-flow) {
.login.is-jetpack:not(.is-automattic-for-agencies-flow) {
.button.is-primary {
background-color: var(--studio-jetpack-green-50);
Expand Down Expand Up @@ -56,7 +56,6 @@ $breakpoint-mobile: 782px; //Mobile size.
}
}

.layout.is-jetpack-woocommerce-flow,
.layout.is-jetpack-woo-dna-flow,
.layout.is-wccom-oauth-flow {
.login__jetpack-logo,
Expand Down
12 changes: 3 additions & 9 deletions client/blocks/signup-form/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,8 @@ class SignupForm extends Component {
}

recordWooCommerceSignupTracks( method ) {
const { isJetpackWooCommerceFlow, isWoo, wccomFrom } = this.props;
if ( isJetpackWooCommerceFlow ) {
recordTracksEvent( 'wcadmin_storeprofiler_create_jetpack_account', {
signup_method: method,
} );
} else if ( isWoo && 'cart' === wccomFrom ) {
const { isWoo, wccomFrom } = this.props;
if ( isWoo && 'cart' === wccomFrom ) {
recordTracksEvent( 'wcadmin_storeprofiler_payment_create_account', {
signup_method: method,
} );
Expand Down Expand Up @@ -1191,7 +1187,7 @@ class SignupForm extends Component {
);
}

if ( this.props.isJetpackWooCommerceFlow || this.props.isJetpackWooDnaFlow ) {
if ( this.props.isJetpackWooDnaFlow ) {
return (
<div className={ clsx( 'signup-form__woocommerce', this.props.className ) }>
<LoggedOutForm onSubmit={ this.handleWooCommerceSubmit } noValidate>
Expand Down Expand Up @@ -1386,8 +1382,6 @@ export default connect(
currentUser: getCurrentUser( state ),
oauth2Client,
sectionName: getSectionName( state ),
isJetpackWooCommerceFlow:
'woocommerce-onboarding' === get( getCurrentQueryArguments( state ), 'from' ),
isJetpackWooDnaFlow: wooDnaConfig( getCurrentQueryArguments( state ) ).isWooDnaFlow(),
from: get( getCurrentQueryArguments( state ), 'from' ),
wccomFrom: getWccomFrom( state ),
Expand Down
21 changes: 0 additions & 21 deletions client/components/jetpack-header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class JetpackHeader extends PureComponent {
darkColorScheme: PropTypes.bool,
partnerSlug: PropTypes.string,
isFromAutomatticForAgenciesPlugin: PropTypes.bool,
isWooOnboarding: PropTypes.bool,
isWooJPC: PropTypes.bool,
isWooDna: PropTypes.bool,
width: PropTypes.number,
Expand All @@ -26,7 +25,6 @@ export class JetpackHeader extends PureComponent {
partnerSlug,
width,
isFromAutomatticForAgenciesPlugin,
isWooOnboarding,
isWooJPC,
isWooDna,
translate,
Expand All @@ -36,25 +34,6 @@ export class JetpackHeader extends PureComponent {
return null;
}

if ( isWooOnboarding ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @mirka in case this deletion unlocks further improvements to the JetpackHeader component

// @todo Implement WooCommerce + partner co-branding in the future.
return (
<JetpackPartnerLogoGroup
width={ width || 662.5 }
viewBox="0 0 1270 170"
partnerName="WooCommerce"
>
<g transform="translate(360 25)">
<AsyncLoad
require="calypso/components/jetpack-header/woocommerce"
darkColorScheme={ darkColorScheme }
placeholder={ null }
/>
</g>
</JetpackPartnerLogoGroup>
);
}

if ( isWooDna ) {
return (
<svg width={ width } viewBox="0 0 1270 170">
Expand Down
9 changes: 1 addition & 8 deletions client/components/social-buttons/qr-code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { resetMagicLoginRequestForm } from 'calypso/state/login/magic-login/acti
import { isFormDisabled } from 'calypso/state/login/selectors';
import { getCurrentOAuth2Client } from 'calypso/state/oauth2-clients/ui/selectors';
import getCurrentLocaleSlug from 'calypso/state/selectors/get-current-locale-slug';
import getCurrentQueryArguments from 'calypso/state/selectors/get-current-query-arguments';
import getIsWoo from 'calypso/state/selectors/get-is-woo';

type QrCodeLoginButtonProps = {
Expand All @@ -18,10 +17,8 @@ type QrCodeLoginButtonProps = {
const QrCodeLoginButton = ( { loginUrl }: QrCodeLoginButtonProps ) => {
const dispatch = useDispatch();
const translate = useTranslate();
const { isDisabled, isJetpackWooCommerceFlow, oauth2Client, isWoo } = useSelector( ( select ) => {
const { isDisabled, oauth2Client, isWoo } = useSelector( ( select ) => {
return {
isJetpackWooCommerceFlow:
'woocommerce-onboarding' === getCurrentQueryArguments( select )?.from,
oauth2Client: getCurrentOAuth2Client( select ) as { id: string },
locale: getCurrentLocaleSlug( select ),
isWoo: getIsWoo( select ),
Expand All @@ -35,10 +32,6 @@ const QrCodeLoginButton = ( { loginUrl }: QrCodeLoginButtonProps ) => {
return null;
}

if ( isJetpackWooCommerceFlow ) {
return null;
}

const handleClick = () => {
recordTracksEvent( 'calypso_login_magic_login_request_click', {
origin: 'login-links',
Expand Down
5 changes: 0 additions & 5 deletions client/document/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class Document extends Component {
query,
reactQueryDevtoolsHelper,
renderedLayout,
requestFrom,
sectionGroup,
sectionName,
storeSandboxHelper,
Expand Down Expand Up @@ -96,9 +95,6 @@ class Document extends Component {
? `var localeFromRoute = ${ jsonStringifyForHtml( params.lang ?? '' ) };\n`
: '' );

const isJetpackWooCommerceFlow =
'jetpack-connect' === sectionName && 'woocommerce-onboarding' === requestFrom;

const isJetpackWooDnaFlow = 'jetpack-connect' === sectionName && isWooDna;

const theme = config( 'theme' );
Expand Down Expand Up @@ -177,7 +173,6 @@ class Document extends Component {
className={ clsx( 'layout', {
[ 'is-group-' + sectionGroup ]: sectionGroup,
[ 'is-section-' + sectionName ]: sectionName,
'is-jetpack-woocommerce-flow': isJetpackWooCommerceFlow,
'is-jetpack-woo-dna-flow': isJetpackWooDnaFlow,
} ) }
>
Expand Down
23 changes: 0 additions & 23 deletions client/jetpack-connect/auth-form-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { authQueryPropTypes } from './utils';
export class AuthFormHeader extends Component {
static propTypes = {
authQuery: authQueryPropTypes.isRequired,
isWooOnboarding: PropTypes.bool,
isWooJPC: PropTypes.bool,
isWpcomMigration: PropTypes.bool,
wooDnaConfig: PropTypes.object,
Expand Down Expand Up @@ -57,7 +56,6 @@ export class AuthFormHeader extends Component {
const {
translate,
partnerSlug,
isWooOnboarding,
isWooJPC,
wooDnaConfig,
isWpcomMigration,
Expand Down Expand Up @@ -96,15 +94,6 @@ export class AuthFormHeader extends Component {

const currentState = this.getState();

if ( isWooOnboarding ) {
switch ( currentState ) {
case 'logged-out':
return translate( 'Create a Jetpack account' );
default:
return translate( 'Connecting your store' );
}
}

if ( isWooJPC ) {
switch ( currentState ) {
case 'logged-out':
Expand Down Expand Up @@ -150,25 +139,13 @@ export class AuthFormHeader extends Component {
getSubHeaderText() {
const {
translate,
isWooOnboarding,
isWooJPC,
wooDnaConfig,
isWpcomMigration,
isFromAutomatticForAgenciesPlugin,
} = this.props;
const currentState = this.getState();

if ( isWooOnboarding ) {
switch ( currentState ) {
case 'logged-out':
return translate(
'Your account will enable you to start using the features and benefits offered by Jetpack & WooCommerce Services.'
);
default:
return translate( "Once connected we'll continue setting up your store" );
}
}

if ( isWooJPC ) {
const pluginName = getPluginTitle( this.props.authQuery?.plugin_name, translate );
const reviewDocLink = (
Expand Down
Loading