From 92770c3bf194920aeb76c8532c6e10fd4d46223f Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 1 Feb 2024 16:53:54 +0530 Subject: [PATCH 1/3] Preview step: Navigate to site logo on back --- .../Header/components/SiteGenHeader/step-navigation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js index b66548465..82b131794 100644 --- a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js +++ b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js @@ -5,6 +5,8 @@ import { __ } from '@wordpress/i18n'; import { store as nfdOnboardingStore } from '../../../../store'; import ButtonDark from '../../../Button/ButtonDark'; +import { stepSiteGenPreview } from '../../../../steps/SiteGen/Preview/step'; +import { stepSiteGenSiteLogo } from '../../../../steps/SiteGen/SiteLogo/step'; /** * Back step Navigation button. @@ -37,18 +39,20 @@ const Back = ( { path, showErrorDialog } ) => { * @return {WPComponent} StepNavigation Component */ const StepNavigation = () => { - const { previousStep, showErrorDialog } = useSelect( ( select ) => { + const { previousStep, currentStep, showErrorDialog } = useSelect( ( select ) => { return { previousStep: select( nfdOnboardingStore ).getPreviousStep(), + currentStep: select( nfdOnboardingStore ).getCurrentStep(), showErrorDialog: select( nfdOnboardingStore ).getShowErrorDialog(), }; }, [] ); const isFirstStep = null === previousStep || false === previousStep; + const isPreviewStep = currentStep.path === stepSiteGenPreview.path; return (
{ isFirstStep ? null : ( ) } From 8d262633f626c92e76313e73438ad22c3bdd733d Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 1 Feb 2024 17:31:01 +0530 Subject: [PATCH 2/3] Lint fix --- .../SiteGenHeader/step-navigation.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js index 82b131794..fc74b3624 100644 --- a/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js +++ b/src/OnboardingSPA/components/Header/components/SiteGenHeader/step-navigation.js @@ -39,20 +39,28 @@ const Back = ( { path, showErrorDialog } ) => { * @return {WPComponent} StepNavigation Component */ const StepNavigation = () => { - const { previousStep, currentStep, showErrorDialog } = useSelect( ( select ) => { - return { - previousStep: select( nfdOnboardingStore ).getPreviousStep(), - currentStep: select( nfdOnboardingStore ).getCurrentStep(), - showErrorDialog: select( nfdOnboardingStore ).getShowErrorDialog(), - }; - }, [] ); + const { previousStep, currentStep, showErrorDialog } = useSelect( + ( select ) => { + return { + previousStep: select( nfdOnboardingStore ).getPreviousStep(), + currentStep: select( nfdOnboardingStore ).getCurrentStep(), + showErrorDialog: + select( nfdOnboardingStore ).getShowErrorDialog(), + }; + }, + [] + ); const isFirstStep = null === previousStep || false === previousStep; const isPreviewStep = currentStep.path === stepSiteGenPreview.path; return (
{ isFirstStep ? null : ( ) } From fef305e6eeac0974536dad1123034cb02f888cab Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 1 Feb 2024 17:55:37 +0530 Subject: [PATCH 3/3] Use cache unless prompt changes --- .../components/NewfoldInterfaceSkeleton/SiteGen/index.js | 7 +++++++ src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js | 1 + 2 files changed, 8 insertions(+) diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js index 8b0b3f8c1..74f059d87 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js @@ -73,6 +73,13 @@ const SiteGen = () => { .then( ( data ) => { if ( data.body !== null ) { currentData.sitegen.siteGenMetaStatus.currentStatus += 1; + if ( + currentData.sitegen.siteGenMetaStatus + .currentStatus === + currentData.sitegen.siteGenMetaStatus.totalCount + ) { + currentData.sitegen.skipCache = false; + } setCurrentOnboardingData( currentData ); } else if ( retryCount < MAX_RETRIES_SITE_GEN ) { performSiteGenMetaGeneration( diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js b/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js index cbf730246..83a2f043c 100644 --- a/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js +++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js @@ -49,6 +49,7 @@ const SiteGenSiteDetails = () => { useEffect( () => { if ( + customerInput !== undefined && customerInput !== '' && customerInput !== currentData.sitegen.siteDetails.prompt ) {