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

Removed error state from fork and welcome step #512

Merged
merged 1 commit into from
Mar 6, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ACTION_ONBOARDING_CHAPTER_STARTED,
} from '../../../utils/analytics/hiive/constants';
import { SITEGEN_FLOW } from '../../../data/flows/constants';
import { stepTheFork } from '../../../steps/TheFork/step';

// Wrapping the NewfoldInterfaceSkeleton with the HOC to make theme available
const ThemedNewfoldInterfaceSkeleton = themeToggleHOC(
Expand Down Expand Up @@ -93,7 +94,8 @@
const prevSiteGenErrorStatus = useRef();

async function syncStoreToDB() {
if ( currentData ) {
// The First Fork Step doesn't have any Store changes
if ( currentData && location?.pathname !== stepTheFork.path ) {
//Set the Flow Data and sync store and DB
const result = await setFlow( currentData );
if ( result?.error !== null ) {
Expand Down Expand Up @@ -292,20 +294,20 @@

useEffect( () => {
trackChapters();
}, [ currentStep ] );

Check warning on line 297 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'trackChapters'. Either include it or remove the dependency array

Check warning on line 297 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'trackChapters'. Either include it or remove the dependency array

useEffect( () => {
if ( initialize ) {
initializePlugins( pluginInstallHash );
setInterval( cronTrigger, 45000 );
}
}, [ initialize ] );

Check warning on line 304 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'pluginInstallHash'. Either include it or remove the dependency array

Check warning on line 304 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'pluginInstallHash'. Either include it or remove the dependency array

useEffect( () => {
syncStoreToDB();
generateSiteGenData();
handlePreviousStepTracking();
}, [ location.pathname ] );

Check warning on line 310 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'generateSiteGenData', 'handlePreviousStepTracking', and 'syncStoreToDB'. Either include them or remove the dependency array

Check warning on line 310 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'generateSiteGenData', 'handlePreviousStepTracking', and 'syncStoreToDB'. Either include them or remove the dependency array

useEffect( () => {
if (
Expand All @@ -316,14 +318,14 @@
syncStoreToDB();
}
prevSiteGenErrorStatus.current = siteGenErrorStatus;
}, [ siteGenErrorStatus ] );

Check warning on line 321 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'generateSiteGenData' and 'syncStoreToDB'. Either include them or remove the dependency array

Check warning on line 321 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'generateSiteGenData' and 'syncStoreToDB'. Either include them or remove the dependency array

useEffect( () => {
initializeThemes();
initializeSettings();
getEditedEntityRecord( 'root', 'site' );
updateSiteGenErrorStatus( false );
}, [] );

Check warning on line 328 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'getEditedEntityRecord' and 'updateSiteGenErrorStatus'. Either include them or remove the dependency array

Check warning on line 328 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'getEditedEntityRecord' and 'updateSiteGenErrorStatus'. Either include them or remove the dependency array

return (
<ThemeProvider>
Expand Down
51 changes: 24 additions & 27 deletions src/OnboardingSPA/steps/SiteGen/Welcome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { store as nfdOnboardingStore } from '../../../store';
import { HEADER_SITEGEN } from '../../../../constants';
import getContents from './contents';
import OrbAnimation from '../../../components/OrbAnimation';
import SitegenAiStateHandler from '../../../components/StateHandlers/SitegenAi';

const SiteGenWelcome = () => {
const {
Expand All @@ -30,33 +29,31 @@ const SiteGenWelcome = () => {

const content = getContents();
return (
<SitegenAiStateHandler>
<CommonLayout className="nfd-onboarding-step--site-gen__welcome">
<div className="nfd-onboarding-step--site-gen__welcome__container">
<div className="nfd-onboarding-step--site-gen__welcome__container__orb">
<OrbAnimation height={ `100px` } />
</div>
<div className="nfd-onboarding-step--site-gen__welcome__container__heading">
<div className="nfd-onboarding-step--site-gen__welcome__container__heading__image"></div>
<p className="nfd-onboarding-step--site-gen__welcome__container__heading__text">
{ content.heading }
</p>
</div>
<div className="nfd-onboarding-step--site-gen__welcome__container__sub-heading">
<p className="nfd-onboarding-step--site-gen__welcome__container__sub-heading__text">
{ content.subHeading }
</p>
</div>
<NextButtonSiteGen
className={
'nfd-onboarding-step--site-gen__welcome--button'
}
text={ content.buttonText }
showChevronRight={ false }
/>
<CommonLayout className="nfd-onboarding-step--site-gen__welcome">
<div className="nfd-onboarding-step--site-gen__welcome__container">
<div className="nfd-onboarding-step--site-gen__welcome__container__orb">
<OrbAnimation height={ `100px` } />
</div>
</CommonLayout>
</SitegenAiStateHandler>
<div className="nfd-onboarding-step--site-gen__welcome__container__heading">
<div className="nfd-onboarding-step--site-gen__welcome__container__heading__image"></div>
<p className="nfd-onboarding-step--site-gen__welcome__container__heading__text">
{ content.heading }
</p>
</div>
<div className="nfd-onboarding-step--site-gen__welcome__container__sub-heading">
<p className="nfd-onboarding-step--site-gen__welcome__container__sub-heading__text">
{ content.subHeading }
</p>
</div>
<NextButtonSiteGen
className={
'nfd-onboarding-step--site-gen__welcome--button'
}
text={ content.buttonText }
showChevronRight={ false }
/>
</div>
</CommonLayout>
);
};

Expand Down
85 changes: 41 additions & 44 deletions src/OnboardingSPA/steps/TheFork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { DEFAULT_FLOW } from '../../data/flows/constants';
import HeadingWithSubHeading from '../../components/HeadingWithSubHeading/SiteGen/index';
import StartOptions from '../../components/StartOptions';
import getContents from './contents';
import SitegenAiStateHandler from '../../components/StateHandlers/SitegenAi';
import {
OnboardingEvent,
sendOnboardingEvent,
Expand Down Expand Up @@ -65,51 +64,49 @@ const TheFork = () => {
};
const content = getContents();
return (
<SitegenAiStateHandler>
<CommonLayout
isCentered
className="nfd-onboarding-step--site-gen__fork"
>
<HeadingWithSubHeading
title={ content.heading }
subtitle={ content.subheading }
/>
<StartOptions
questionnaire={ content.questionnaire }
oldFlow={ oldFlow }
options={ content.options }
/>
<br />
<br />
{ migrationUrl && (
<a
className="nfd-onboarding-step--site-gen__fork__importsite"
href={ migrationUrl }
target={ '_blank' }
rel={ 'noreferrer' }
onClick={ () =>
trackOnboardingEvent(
new OnboardingEvent(
ACTION_SITEGEN_FORK_OPTION_SELECTED,
'MIGRATE'
)
<CommonLayout
isCentered
className="nfd-onboarding-step--site-gen__fork"
>
<HeadingWithSubHeading
title={ content.heading }
subtitle={ content.subheading }
/>
<StartOptions
questionnaire={ content.questionnaire }
oldFlow={ oldFlow }
options={ content.options }
/>
<br />
<br />
{ migrationUrl && (
<a
className="nfd-onboarding-step--site-gen__fork__importsite"
href={ migrationUrl }
target={ '_blank' }
rel={ 'noreferrer' }
onClick={ () =>
trackOnboardingEvent(
new OnboardingEvent(
ACTION_SITEGEN_FORK_OPTION_SELECTED,
'MIGRATE'
)
}
>
{ content.importtext }
</a>
) }
<span
role="button"
tabIndex={ 0 }
className="nfd-onboarding-step--site-gen__fork__exit"
onClick={ () => handleForkExit() }
onKeyDown={ () => handleForkExit() }
)
}
>
{ content.exitToWordPress }
</span>
</CommonLayout>
</SitegenAiStateHandler>
{ content.importtext }
</a>
) }
<span
role="button"
tabIndex={ 0 }
className="nfd-onboarding-step--site-gen__fork__exit"
onClick={ () => handleForkExit() }
onKeyDown={ () => handleForkExit() }
>
{ content.exitToWordPress }
</span>
</CommonLayout>
);
};

Expand Down
Loading