From 54481f19ccebef560983a932a6388b9b47e2c60f Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Thu, 4 Apr 2024 21:10:41 +0530 Subject: [PATCH] add as a default route --- .../components/NewfoldInterfaceSkeleton/SiteBuild/index.js | 4 ++++ src/OnboardingSPA/data/flows/ecommerce.js | 2 ++ src/OnboardingSPA/data/flows/sitegen.js | 3 +-- src/OnboardingSPA/utils/api/siteGen.js | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js index 954a9a660..35e27a6f1 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js @@ -55,6 +55,7 @@ import { stepTheFork } from '../../../steps/TheFork/step'; import { ThemeProvider } from '../../ThemeContextProvider'; import themeToggleHOC from '../themeToggleHOC'; import Footer from '../../Footer'; +import { stepMigration } from '../../../steps/SiteGen/Migration/step'; const SiteBuild = () => { const location = useLocation(); @@ -67,6 +68,7 @@ const SiteBuild = () => { onboardingFlow, currentData, currentStep, + currentRoute, lastChapter, socialData, firstStep, @@ -99,6 +101,7 @@ const SiteBuild = () => { initialize: select( nfdOnboardingStore ).getInitialize(), pluginInstallHash: select( nfdOnboardingStore ).getPluginInstallHash(), + currentRoute: select( nfdOnboardingStore ).getCurrentStepPath(), }; }, [ location.pathname ] @@ -431,6 +434,7 @@ const SiteBuild = () => { const isForkStep = currentStep === stepTheFork || + currentRoute === stepMigration.path || window.nfdOnboarding.currentFlow === 'sitegen'; // wrapping the NewfoldInterfaceSkeleton with the HOC to make 'theme' available const ThemedNewfoldInterfaceSkeleton = themeToggleHOC( diff --git a/src/OnboardingSPA/data/flows/ecommerce.js b/src/OnboardingSPA/data/flows/ecommerce.js index 68bca7e04..956c6d2e5 100644 --- a/src/OnboardingSPA/data/flows/ecommerce.js +++ b/src/OnboardingSPA/data/flows/ecommerce.js @@ -19,6 +19,7 @@ import { filter } from 'lodash'; import { store } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; import { stepTheFork } from '../../steps/TheFork/step'; +import { stepMigration } from '../../steps/SiteGen/Migration/step'; export const pages = [ indexPage, errorPage ]; @@ -50,6 +51,7 @@ export const getSteps = ( chapters = initialChapters ) => { export const getRoutes = ( chapters = initialChapters ) => { let routes = [ ...pages ]; routes.push( stepTheFork ); + routes.push( stepMigration ); routes.push( stepWelcome ); chapters.forEach( ( chapter ) => { routes = routes.concat( [ diff --git a/src/OnboardingSPA/data/flows/sitegen.js b/src/OnboardingSPA/data/flows/sitegen.js index 02537f33f..525ddc303 100644 --- a/src/OnboardingSPA/data/flows/sitegen.js +++ b/src/OnboardingSPA/data/flows/sitegen.js @@ -4,7 +4,6 @@ import { siteGenCore } from '../../chapters/siteGen/core'; import { errorPage } from '../../pages/ErrorPage/page'; import { indexPage } from '../../pages/IndexPage/page'; import { stepSiteGenWelcome } from '../../steps/SiteGen/Welcome/step'; -import { stepMigration } from '../../steps/SiteGen/Migration/step'; import { stepTheFork } from '../../steps/TheFork/step'; export const pages = [ indexPage, errorPage ]; @@ -25,7 +24,7 @@ export const getSteps = ( chapters = initialChapters ) => { export const getRoutes = ( chapters = initialChapters ) => { let routes = [ ...pages ]; - routes.push( stepTheFork, stepSiteGenWelcome, stepMigration ); + routes.push( stepTheFork, stepSiteGenWelcome ); chapters.forEach( ( chapter ) => { routes = routes.concat( [ ...chapter.steps, diff --git a/src/OnboardingSPA/utils/api/siteGen.js b/src/OnboardingSPA/utils/api/siteGen.js index 780fc0090..151898e09 100644 --- a/src/OnboardingSPA/utils/api/siteGen.js +++ b/src/OnboardingSPA/utils/api/siteGen.js @@ -95,4 +95,4 @@ export async function getSiteMigrateUrl() { url: migrateRestURL( 'migrate/connect' ), } ).then() ); -} \ No newline at end of file +}