Skip to content

Commit

Permalink
Onboarding: Show preview for all segments other than blog (#33236)
Browse files Browse the repository at this point in the history
  • Loading branch information
spen authored and ramonjd committed May 31, 2019
1 parent 886fa61 commit 91c59bb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
15 changes: 15 additions & 0 deletions client/signup/config/flows-pure.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ export function generateFlows( {
},

onboarding: {
steps: [
'user',
'site-type',
'site-topic-with-preview',
'site-title-with-preview',
'domains-with-preview',
'plans',
],
destination: getChecklistDestination,
description: 'The improved onboarding flow.',
lastModified: '2019-04-30',
},

// We don't yet show the previews for the 'blog' segment
'onboarding-blog': {
steps: [ 'user', 'site-type', 'site-topic', 'site-title', 'domains', 'plans' ],
destination: getChecklistDestination,
description: 'The improved onboarding flow.',
Expand Down
17 changes: 8 additions & 9 deletions client/signup/steps/site-type/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import StepWrapper from 'signup/step-wrapper';
import { getSiteType } from 'state/signup/steps/site-type/selectors';
import { submitSiteType } from 'state/signup/steps/site-type/actions';

const siteTypeToFlowname = {
'online-store': 'ecommerce-onboarding',
business: 'onboarding-for-business',
blog: 'onboarding-blog',
};

class SiteType extends Component {
componentDidMount() {
SignupActions.saveSignupStep( {
Expand Down Expand Up @@ -67,15 +73,8 @@ export default connect(
submitStep: siteTypeValue => {
dispatch( submitSiteType( siteTypeValue ) );

if ( 'online-store' === siteTypeValue ) {
flowName = 'ecommerce-onboarding';
}

if ( 'business' === siteTypeValue ) {
flowName = 'onboarding-for-business';
}

goToNextStep( flowName );
// Modify the flowname if the site type matches an override.
goToNextStep( siteTypeToFlowname[ siteTypeValue ] || flowName );
},
} )
)( localize( SiteType ) );

0 comments on commit 91c59bb

Please sign in to comment.