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

Move all flows to non reskinned ui #98561

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
45 changes: 3 additions & 42 deletions client/signup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import { createElement } from 'react';
import store from 'store';
import { notFound } from 'calypso/controller';
import { recordPageView } from 'calypso/lib/analytics/page-view';
import { isWooOAuth2Client } from 'calypso/lib/oauth2-clients';
import { login } from 'calypso/lib/paths';
import { sectionify } from 'calypso/lib/route';
import { addQueryArgs } from 'calypso/lib/url';
import flows from 'calypso/signup/config/flows';
import { isUserLoggedIn } from 'calypso/state/current-user/selectors';
import { getCurrentOAuth2Client } from 'calypso/state/oauth2-clients/ui/selectors';
import { updateDependencies } from 'calypso/state/signup/actions';
import { getSignupDependencyStore } from 'calypso/state/signup/dependency-store/selectors';
import { setCurrentFlowName, setPreviousFlowName } from 'calypso/state/signup/flow/actions';
Expand All @@ -24,7 +22,6 @@ import { getSiteId } from 'calypso/state/sites/selectors';
import { setSelectedSiteId } from 'calypso/state/ui/actions';
import { setLayoutFocus } from 'calypso/state/ui/layout-focus/actions';
import { getStepComponent } from './config/step-components';
import { isReskinnedFlow } from './is-flow';
import SignupComponent from './main';
import {
retrieveSignupDestination,
Expand Down Expand Up @@ -54,14 +51,6 @@ const basePageTitle = 'Signup'; // used for analytics, doesn't require translati
let initialContext;
let previousFlowName;

const removeWhiteBackground = function () {
if ( ! document ) {
return;
}

document.body.classList.remove( 'is-white-signup' );
};

function setReferrerPolicy() {
try {
// Remove existing <meta> tags with name="referrer"
Expand Down Expand Up @@ -104,39 +93,11 @@ export const removeP2SignupClassName = function () {

export default {
redirectTests( context, next ) {
const isLoggedIn = isUserLoggedIn( context.store.getState() );
const currentFlowName = getFlowName( context.params, isLoggedIn );
const isWoo = isWooOAuth2Client( getCurrentOAuth2Client( context.store.getState() ) );

if ( isReskinnedFlow( currentFlowName ) ) {
next();
} else if ( isWoo ) {
// Do nothing, Woo flow background should keep white.
next();
} else if (
context.pathname.indexOf( 'domain' ) >= 0 ||
context.pathname.indexOf( 'plan' ) >= 0 ||
context.pathname.indexOf( 'onboarding-registrationless' ) >= 0 ||
context.pathname.indexOf( 'wpcc' ) >= 0 ||
context.pathname.indexOf( 'launch-only' ) >= 0 ||
context.params.flowName === 'account' ||
context.params.flowName === 'crowdsignal' ||
context.params.flowName === 'clone-site'
) {
removeWhiteBackground();
next();
} else if ( context.pathname.includes( 'p2' ) ) {
addP2SignupClassName();
removeWhiteBackground();
next();
} else if ( context.pathname.includes( 'videopress' ) ) {
if ( context.pathname.includes( 'videopress' ) ) {
addVideoPressSignupClassName();
removeWhiteBackground();
next();
} else {
next();
return;
}

next();
},
redirectWithoutLocaleIfLoggedIn( context, next ) {
const userLoggedIn = isUserLoggedIn( context.store.getState() );
Expand Down
4 changes: 4 additions & 0 deletions client/signup/is-flow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import config from '@automattic/calypso-config';
import { getQueryArg } from '@wordpress/url';

export const isReskinnedFlow = ( flowName: string ) => {
if ( getQueryArg( window.location.href, 'nr' ) ) {
return false;
}
Comment on lines +5 to +7
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added utility for easy testing until this construct is removed.

return config< string[] >( 'reskinned_flows' ).includes( flowName );
};

Expand Down
4 changes: 2 additions & 2 deletions client/signup/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ body.is-section-signup .layout:not(.dops):not(.is-wccom-oauth-flow) .formatted-h
color: var(--color-text-inverted);
}

a {
.signup:not(.is-wpcc):not(.is-crowdsignal) a {
color: var(--color-neutral-0);
text-decoration: underline;

Expand Down Expand Up @@ -393,7 +393,7 @@ body.is-section-signup .layout:not(.dops):not(.is-wccom-oauth-flow) .formatted-h
* Common styles for reskinSignupFlow a/b test
*/
body.is-section-stepper,
body.is-section-signup.is-white-signup .layout:not(.dops):not(.is-wccom-oauth-flow) {
body.is-section-signup.is-white-signup:not(.is-videopress-signup) .layout:not(.dops):not(.is-wccom-oauth-flow) {
$gray-100: #101517;
$gray-60: #50575e;
$gray-50: #646970;
Expand Down
9 changes: 9 additions & 0 deletions config/_shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,14 @@
"restricted_me_access": true,
"theme_color": "",
"reskinned_flows": [
"__disabled_onboarding",
"account",
"business",
"business-2y",
"business-3y",
"business-monthly",
"clone-site",
"crowdsignal",
"do-it-for-me",
"do-it-for-me-store",
"domain",
Expand All @@ -219,10 +222,12 @@
"hosting",
"hosting-start",
"import",
"launch-only",
"launch-site",
"onboarding",
"onboarding-affiliate",
"onboarding-pm",
"onboarding-registrationless",
"onboarding-with-email",
"personal",
"personal-2y",
Expand All @@ -234,15 +239,19 @@
"premium-3y",
"premium-monthly",
"reader",
"rewind-auto-config",
"rewind-setup",
"setup-site",
"site-content-collection",
"site-selected",
"videopress-account",
"website-design-services",
"with-plugin",
"with-theme",
"woocommerce-install",
"wpcc"
],
"reskin_breaking": [],
"100_year_plan_calendly_id": "wpcom-100-years/30min",
"bilmur_url": "https://s0.wp.com/wp-content/js/bilmur.min.js"
}
Loading