diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js index d2ea85fc1..de70b0cec 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js @@ -297,7 +297,7 @@ const SiteBuild = () => { trackOnboardingEvent( new OnboardingEvent( ACTION_STARTER_PAGES_SELECTED, - sitePages.map( ( sitePage ) => sitePage.title ), + sitePages.map( ( sitePage ) => sitePage.key ), { count: sitePages.length, }, diff --git a/src/OnboardingSPA/data/models/Step.js b/src/OnboardingSPA/data/models/Step.js index cebaac1bf..fd4b46d73 100644 --- a/src/OnboardingSPA/data/models/Step.js +++ b/src/OnboardingSPA/data/models/Step.js @@ -1,5 +1,6 @@ export class Step { constructor( { + slug, path, title, Component, @@ -10,6 +11,7 @@ export class Step { data, drawerNavigation, } ) { + this.slug = slug; this.path = path; this.title = title; this.Component = Component; diff --git a/src/OnboardingSPA/steps/BasicInfo/step.js b/src/OnboardingSPA/steps/BasicInfo/step.js index 10eee8d2f..b5b4a02f9 100644 --- a/src/OnboardingSPA/steps/BasicInfo/step.js +++ b/src/OnboardingSPA/steps/BasicInfo/step.js @@ -9,6 +9,7 @@ import { VIEW_NAV_PRIMARY } from '../../../constants'; const StepBasicInfo = lazy( () => import( './index' ) ); export const stepBasicInfo = new Step( { + slug: 'basic-info', path: '/wp-setup/step/basic-info', title: __( 'Basic Info', 'wp-module-onboarding' ), Component: StepBasicInfo, diff --git a/src/OnboardingSPA/steps/Complete/step.js b/src/OnboardingSPA/steps/Complete/step.js index 3eca57840..9fdb4cb90 100644 --- a/src/OnboardingSPA/steps/Complete/step.js +++ b/src/OnboardingSPA/steps/Complete/step.js @@ -4,6 +4,7 @@ import { Step } from '../../data/models/Step'; const StepComplete = lazy( () => import( './index' ) ); export const stepComplete = new Step( { + slug: 'complete', path: '/wp-setup/step/complete', Component: StepComplete, } ); diff --git a/src/OnboardingSPA/steps/DesignColors/step.js b/src/OnboardingSPA/steps/DesignColors/step.js index b62e28129..f55a02c41 100644 --- a/src/OnboardingSPA/steps/DesignColors/step.js +++ b/src/OnboardingSPA/steps/DesignColors/step.js @@ -8,6 +8,7 @@ import { VIEW_DESIGN_COLORS } from '../../../constants'; const StepDesignColors = lazy( () => import( './index' ) ); export const stepDesignColors = new Step( { + slug: 'design-colors', path: '/wp-setup/step/design/colors', title: __( 'Colors', 'wp-module-onboarding' ), Component: StepDesignColors, diff --git a/src/OnboardingSPA/steps/DesignFonts/step.js b/src/OnboardingSPA/steps/DesignFonts/step.js index d40352f4a..7666edf45 100644 --- a/src/OnboardingSPA/steps/DesignFonts/step.js +++ b/src/OnboardingSPA/steps/DesignFonts/step.js @@ -8,6 +8,7 @@ import { VIEW_DESIGN_FONTS } from '../../../constants'; const StepDesignFonts = lazy( () => import( './index' ) ); export const stepDesignFonts = new Step( { + slug: 'design-typography', path: '/wp-setup/step/design/typography', title: __( 'Fonts', 'wp-module-onboarding' ), Component: StepDesignFonts, diff --git a/src/OnboardingSPA/steps/DesignHeaderMenu/step.js b/src/OnboardingSPA/steps/DesignHeaderMenu/step.js index 7be48fab2..d4442c870 100644 --- a/src/OnboardingSPA/steps/DesignHeaderMenu/step.js +++ b/src/OnboardingSPA/steps/DesignHeaderMenu/step.js @@ -8,6 +8,7 @@ import { VIEW_DESIGN_HEADER_MENU } from '../../../constants'; const StepDesignHeaderMenu = lazy( () => import( './index' ) ); export const stepDesignHeaderMenu = new Step( { + slug: 'design-header-menu', path: '/wp-setup/step/design/header-menu', title: __( 'Header & Menu', 'wp-module-onboarding' ), Component: StepDesignHeaderMenu, diff --git a/src/OnboardingSPA/steps/DesignHomepageMenu/step.js b/src/OnboardingSPA/steps/DesignHomepageMenu/step.js index 85826337d..4ffb5f9e2 100644 --- a/src/OnboardingSPA/steps/DesignHomepageMenu/step.js +++ b/src/OnboardingSPA/steps/DesignHomepageMenu/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_DESIGN } from '../../../constants'; const StepDesignHomepageMenu = lazy( () => import( './index' ) ); export const stepDesignHomepageMenu = new Step( { + slug: 'design-homepage-menu', path: '/wp-setup/step/design/homepage-menu', title: __( 'Homepage Layouts', 'wp-module-onboarding' ), Component: StepDesignHomepageMenu, diff --git a/src/OnboardingSPA/steps/DesignThemeStyles/Menu/step.js b/src/OnboardingSPA/steps/DesignThemeStyles/Menu/step.js index 3dcec580e..c383d3ebe 100644 --- a/src/OnboardingSPA/steps/DesignThemeStyles/Menu/step.js +++ b/src/OnboardingSPA/steps/DesignThemeStyles/Menu/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_DESIGN } from '../../../../constants'; const StepDesignThemeStylesMenu = lazy( () => import( './index' ) ); export const stepDesignThemeStylesMenu = new Step( { + slug: 'design-theme-styles-menu', path: '/wp-setup/step/design/theme-styles/menu', title: __( 'Theme Styles', 'wp-module-onboarding' ), Component: StepDesignThemeStylesMenu, diff --git a/src/OnboardingSPA/steps/DesignThemeStyles/Preview/step.js b/src/OnboardingSPA/steps/DesignThemeStyles/Preview/step.js index 4e27e5db9..09aaf5ab6 100644 --- a/src/OnboardingSPA/steps/DesignThemeStyles/Preview/step.js +++ b/src/OnboardingSPA/steps/DesignThemeStyles/Preview/step.js @@ -8,6 +8,7 @@ import { VIEW_DESIGN_THEME_STYLES_PREVIEW } from '../../../../constants'; const StepDesignThemeStylesPreview = lazy( () => import( './index' ) ); export const stepDesignThemeStylesPreview = new Step( { + slug: 'design-theme-styles-preview', path: '/wp-setup/step/design/theme-styles/preview', title: __( 'Theme Styles', 'wp-module-onboarding' ), Component: StepDesignThemeStylesPreview, diff --git a/src/OnboardingSPA/steps/Ecommerce/StepAddress/step.js b/src/OnboardingSPA/steps/Ecommerce/StepAddress/step.js index 57199263b..7d2275487 100644 --- a/src/OnboardingSPA/steps/Ecommerce/StepAddress/step.js +++ b/src/OnboardingSPA/steps/Ecommerce/StepAddress/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_ECOMMERCE_STORE_INFO } from '../../../../constants'; const StepAddress = lazy( () => import( './index' ) ); export const stepAddress = new Step( { + slug: 'ecommerce-address', path: '/ecommerce/step/address', title: __( 'Street Address', 'wp-module-onboarding' ), Component: StepAddress, diff --git a/src/OnboardingSPA/steps/Ecommerce/StepProducts/step.js b/src/OnboardingSPA/steps/Ecommerce/StepProducts/step.js index 2a181937c..2402c4084 100644 --- a/src/OnboardingSPA/steps/Ecommerce/StepProducts/step.js +++ b/src/OnboardingSPA/steps/Ecommerce/StepProducts/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_ECOMMERCE_STORE_INFO } from '../../../../constants'; const StepProducts = lazy( () => import( './index' ) ); export const stepProducts = new Step( { + slug: 'ecommerce-products', path: '/ecommerce/step/products', title: __( 'Product Info', 'wp-module-onboarding' ), Component: StepProducts, diff --git a/src/OnboardingSPA/steps/Ecommerce/StepTax/step.js b/src/OnboardingSPA/steps/Ecommerce/StepTax/step.js index fdc4467da..acec0b4c1 100644 --- a/src/OnboardingSPA/steps/Ecommerce/StepTax/step.js +++ b/src/OnboardingSPA/steps/Ecommerce/StepTax/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_ECOMMERCE_STORE_INFO } from '../../../../constants'; const StepTax = lazy( () => import( './index' ) ); export const stepTax = new Step( { + slug: 'ecommerce-tax', path: '/ecommerce/step/tax', title: __( 'Tax Info', 'wp-module-onboarding' ), Component: StepTax, diff --git a/src/OnboardingSPA/steps/GetStarted/GetStartedExperience/step.js b/src/OnboardingSPA/steps/GetStarted/GetStartedExperience/step.js index a6c0824d4..b5dd9812b 100644 --- a/src/OnboardingSPA/steps/GetStarted/GetStartedExperience/step.js +++ b/src/OnboardingSPA/steps/GetStarted/GetStartedExperience/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_GET_STARTED } from '../../../../constants'; const GetStartedExperience = lazy( () => import( './index' ) ); export const stepExperience = new Step( { + slug: 'get-started-experience', path: '/wp-setup/step/get-started/experience', title: __( 'WordPress Experience', 'wp-module-onboarding' ), Component: GetStartedExperience, diff --git a/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/PrimarySite/step.js b/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/PrimarySite/step.js index 60d037b18..cc0cfe178 100644 --- a/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/PrimarySite/step.js +++ b/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/PrimarySite/step.js @@ -8,6 +8,7 @@ import { translations } from '../../../../utils/locales/translations'; const StepPrimarySetup = lazy( () => import( './index' ) ); export const stepPrimarySetup = new Step( { + slug: 'get-started-site-primary', path: '/wp-setup/step/get-started/site-primary', title: sprintf( /* translators: %s: website or store */ diff --git a/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/SecondarySite/step.js b/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/SecondarySite/step.js index 11f823afb..96059811b 100644 --- a/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/SecondarySite/step.js +++ b/src/OnboardingSPA/steps/GetStarted/SiteTypeSetup/SecondarySite/step.js @@ -8,6 +8,7 @@ import { translations } from '../../../../utils/locales/translations'; const StepSecondaryStep = lazy( () => import( './index' ) ); export const stepSecondarySetup = new Step( { + slug: 'get-started-site-secondary', path: '/wp-setup/step/get-started/site-secondary', title: sprintf( /* translators: %s: website or store */ diff --git a/src/OnboardingSPA/steps/GetStarted/Welcome/step.js b/src/OnboardingSPA/steps/GetStarted/Welcome/step.js index 6a5a2f365..b1da853e1 100644 --- a/src/OnboardingSPA/steps/GetStarted/Welcome/step.js +++ b/src/OnboardingSPA/steps/GetStarted/Welcome/step.js @@ -8,6 +8,7 @@ import { VIEW_NAV_GET_STARTED } from '../../../../constants'; const StepWelcome = lazy( () => import( './index' ) ); export const stepWelcome = new Step( { + slug: 'get-started-welcome', path: '/wp-setup/step/get-started/welcome', title: __( 'Welcome', 'wp-module-onboarding' ), Component: StepWelcome, diff --git a/src/OnboardingSPA/steps/SiteFeatures/step.js b/src/OnboardingSPA/steps/SiteFeatures/step.js index 1f563069f..59f69847a 100644 --- a/src/OnboardingSPA/steps/SiteFeatures/step.js +++ b/src/OnboardingSPA/steps/SiteFeatures/step.js @@ -7,6 +7,7 @@ import LearnMore from './Sidebar/LearnMore'; const StepSiteFeatures = lazy( () => import( './index' ) ); export const stepSiteFeatures = new Step( { + slug: 'site-features', path: '/wp-setup/step/site-features', title: __( 'Features', 'wp-module-onboarding' ), Component: StepSiteFeatures, diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/step.js b/src/OnboardingSPA/steps/SiteGen/Editor/step.js index 09b674008..ad17c4e0f 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/step.js +++ b/src/OnboardingSPA/steps/SiteGen/Editor/step.js @@ -8,6 +8,7 @@ import Customize from './Sidebar/Customize'; const StepSiteGenEditor = lazy( () => import( './index' ) ); export const stepSiteGenEditor = new Step( { + slug: 'sitegen-editor', path: '/sitegen/step/editor', title: __( 'Page Layouts', 'wp-module-onboarding' ), Component: StepSiteGenEditor, diff --git a/src/OnboardingSPA/steps/SiteGen/Experience/step.js b/src/OnboardingSPA/steps/SiteGen/Experience/step.js index d0a216dd1..48826f494 100644 --- a/src/OnboardingSPA/steps/SiteGen/Experience/step.js +++ b/src/OnboardingSPA/steps/SiteGen/Experience/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const SiteGenExperience = lazy( () => import( './index' ) ); export const stepSiteGenExperience = new Step( { + slug: 'sitegen-experience', path: '/sitegen/step/experience', title: __( 'Page Layouts', 'wp-module-onboarding' ), Component: SiteGenExperience, diff --git a/src/OnboardingSPA/steps/SiteGen/Migration/step.js b/src/OnboardingSPA/steps/SiteGen/Migration/step.js index 840a223c4..ddcba0742 100644 --- a/src/OnboardingSPA/steps/SiteGen/Migration/step.js +++ b/src/OnboardingSPA/steps/SiteGen/Migration/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const StepSiteGenMigration = lazy( () => import( './index' ) ); export const stepSiteGenMigration = new Step( { + slug: 'sitegen-migration', path: '/sitegen/step/migration', title: __( 'Migration', 'wp-module-onboarding' ), Component: StepSiteGenMigration, diff --git a/src/OnboardingSPA/steps/SiteGen/Preview/step.js b/src/OnboardingSPA/steps/SiteGen/Preview/step.js index ca992dc40..40ff4fa51 100644 --- a/src/OnboardingSPA/steps/SiteGen/Preview/step.js +++ b/src/OnboardingSPA/steps/SiteGen/Preview/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const SiteGenPreview = lazy( () => import( './index' ) ); export const stepSiteGenPreview = new Step( { + slug: 'sitegen-preview', path: '/sitegen/step/preview', title: __( 'Page Layouts', 'wp-module-onboarding' ), Component: SiteGenPreview, diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/step.js b/src/OnboardingSPA/steps/SiteGen/SiteDetails/step.js index 7f6cbd78a..d2cdbc4e2 100644 --- a/src/OnboardingSPA/steps/SiteGen/SiteDetails/step.js +++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const SiteGenSiteDetails = lazy( () => import( './index' ) ); export const stepSiteGenSiteDetails = new Step( { + slug: 'sitegen-site-details', path: '/sitegen/step/site-details', title: __( 'Site Details', 'wp-module-onboarding' ), Component: SiteGenSiteDetails, diff --git a/src/OnboardingSPA/steps/SiteGen/SiteLogo/step.js b/src/OnboardingSPA/steps/SiteGen/SiteLogo/step.js index 0a1b940d3..0c4c65680 100644 --- a/src/OnboardingSPA/steps/SiteGen/SiteLogo/step.js +++ b/src/OnboardingSPA/steps/SiteGen/SiteLogo/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const SiteGenSiteLogo = lazy( () => import( './index' ) ); export const stepSiteGenSiteLogo = new Step( { + slug: 'sitegen-site-logo', path: '/sitegen/step/site-logo', title: __( 'Page Layouts', 'wp-module-onboarding' ), Component: SiteGenSiteLogo, diff --git a/src/OnboardingSPA/steps/SiteGen/SocialMedia/step.js b/src/OnboardingSPA/steps/SiteGen/SocialMedia/step.js index cee374291..d02d8a305 100644 --- a/src/OnboardingSPA/steps/SiteGen/SocialMedia/step.js +++ b/src/OnboardingSPA/steps/SiteGen/SocialMedia/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const SiteGenSiteSocialMedia = lazy( () => import( './index' ) ); export const stepSiteGenSocialMedia = new Step( { + slug: 'sitegen-social-media', path: '/sitegen/step/social-media', title: __( 'Page Layouts', 'wp-module-onboarding' ), Component: SiteGenSiteSocialMedia, diff --git a/src/OnboardingSPA/steps/SiteGen/Welcome/step.js b/src/OnboardingSPA/steps/SiteGen/Welcome/step.js index 705b3f04f..ccac8b0b4 100644 --- a/src/OnboardingSPA/steps/SiteGen/Welcome/step.js +++ b/src/OnboardingSPA/steps/SiteGen/Welcome/step.js @@ -6,6 +6,7 @@ import { Step } from '../../../data/models/Step'; const SiteGenWelcome = lazy( () => import( './index' ) ); export const stepSiteGenWelcome = new Step( { + slug: 'sitegen-welcome', path: '/sitegen/step/welcome', title: __( 'Welcome', 'wp-module-onboarding' ), Component: SiteGenWelcome, diff --git a/src/OnboardingSPA/steps/SitePages/index.js b/src/OnboardingSPA/steps/SitePages/index.js index 6cd9986fa..70dded9b6 100644 --- a/src/OnboardingSPA/steps/SitePages/index.js +++ b/src/OnboardingSPA/steps/SitePages/index.js @@ -86,13 +86,14 @@ const StepSitePages = () => { const stateToFlowData = ( selectedPages, pages ) => { return pages !== false ? pages?.reduce( ( newSitePages, sitePage ) => { - return selectedPages.includes( sitePage.slug ) - ? newSitePages.concat( { - slug: sitePage.slug, - title: sitePage.title, - } ) - : newSitePages; - }, [] ) + return selectedPages.includes( sitePage.slug ) + ? newSitePages.concat( { + slug: sitePage.slug, + title: sitePage.title, + key: undefined !== sitePage.key ? sitePage.key : sitePage.title, + } ) + : newSitePages; + }, [] ) : undefined; }; diff --git a/src/OnboardingSPA/steps/SitePages/step.js b/src/OnboardingSPA/steps/SitePages/step.js index 8bf0dc2e8..c79c02a13 100644 --- a/src/OnboardingSPA/steps/SitePages/step.js +++ b/src/OnboardingSPA/steps/SitePages/step.js @@ -7,6 +7,7 @@ import LearnMore from './Sidebar/LearnMore'; const StepSitePages = lazy( () => import( './index' ) ); export const stepSitePages = new Step( { + slug: 'design-site-pages', path: '/wp-setup/step/design/site-pages', title: __( 'Page Layouts', 'wp-module-onboarding' ), Component: StepSitePages, diff --git a/src/OnboardingSPA/steps/TheFork/step.js b/src/OnboardingSPA/steps/TheFork/step.js index d2f833d37..a04e2efd6 100644 --- a/src/OnboardingSPA/steps/TheFork/step.js +++ b/src/OnboardingSPA/steps/TheFork/step.js @@ -6,6 +6,7 @@ import { Step } from '../../data/models/Step'; const StepTheFork = lazy( () => import( './index' ) ); export const stepTheFork = new Step( { + slug: 'fork', path: '/wp-setup/step/fork', title: __( 'The Fork', 'wp-module-onboarding' ), Component: StepTheFork, diff --git a/src/OnboardingSPA/steps/TopPriority/index.js b/src/OnboardingSPA/steps/TopPriority/index.js index d42ab1621..cdc9e2841 100644 --- a/src/OnboardingSPA/steps/TopPriority/index.js +++ b/src/OnboardingSPA/steps/TopPriority/index.js @@ -121,7 +121,7 @@ const StepTopPriority = () => { trackOnboardingEvent( new OnboardingEvent( ACTION_ONBOARDING_STEP_SKIPPED, - currentStep.title + currentStep.slug ) ); }; diff --git a/src/OnboardingSPA/steps/TopPriority/step.js b/src/OnboardingSPA/steps/TopPriority/step.js index a7786a046..48ca41d28 100644 --- a/src/OnboardingSPA/steps/TopPriority/step.js +++ b/src/OnboardingSPA/steps/TopPriority/step.js @@ -6,6 +6,7 @@ import { navigation } from '@wordpress/icons'; const StepTopPriority = lazy( () => import( './index' ) ); export const stepTopPriority = new Step( { + slug: 'top-priority', path: '/wp-setup/step/top-priority', title: __( 'Top Priority', 'wp-module-onboarding' ), tooltipText: __( 'Tell us your top priority', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/steps/WhatNext/step.js b/src/OnboardingSPA/steps/WhatNext/step.js index 6aaaea0c5..ed8ff8b12 100644 --- a/src/OnboardingSPA/steps/WhatNext/step.js +++ b/src/OnboardingSPA/steps/WhatNext/step.js @@ -7,6 +7,7 @@ import LearnMore from './Sidebar/LearnMore'; const StepWhatNext = lazy( () => import( './index' ) ); export const stepWhatNext = new Step( { + slug: 'what-next', path: '/wp-setup/step/what-next', title: __( 'What Next', 'wp-module-onboarding' ), Component: StepWhatNext,