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

Prioritization Disabled: Loader for Commerce Steps #319

Merged
merged 1 commit into from
Sep 28, 2023
Merged
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
13 changes: 13 additions & 0 deletions src/OnboardingSPA/components/StateHandlers/Flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
updateDesignRoutes,
setCurrentOnboardingData,
setActiveChapter,
setIsDrawerOpened,
setIsDrawerSuppressed,
setIsHeaderNavigationEnabled,
setSidebarActiveView,
} = useDispatch( nfdOnboardingStore );

const handleCommerceFlow = async ( flow, retries = 0 ) => {
Expand Down Expand Up @@ -170,19 +174,28 @@
if ( false !== brandConfig?.prioritization ) {
return prioritizeFlow();
}
}, [ experienceLevel, topPriority ] );

Check warning on line 177 in src/OnboardingSPA/components/StateHandlers/Flow/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'brandConfig?.prioritization' and 'prioritizeFlow'. Either include them or remove the dependency array

Check warning on line 177 in src/OnboardingSPA/components/StateHandlers/Flow/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'brandConfig?.prioritization' and 'prioritizeFlow'. Either include them or remove the dependency array

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

Check warning on line 181 in src/OnboardingSPA/components/StateHandlers/Flow/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 181 in src/OnboardingSPA/components/StateHandlers/Flow/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

const disableNavigation = () => {
setIsDrawerOpened( false );
setIsDrawerSuppressed( true );
setIsHeaderNavigationEnabled( false );
setSidebarActiveView( false );
};

useEffect( () => {
if ( window.nfdOnboarding?.newFlow ) {
const flow = window.nfdOnboarding.newFlow;
disableNavigation();
setNewFlow( flow );
switchToNewFlow( flow );
window.nfdOnboarding.newFlow = undefined;
}
}, [ location.pathname ] );

Check warning on line 198 in src/OnboardingSPA/components/StateHandlers/Flow/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

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

Check warning on line 198 in src/OnboardingSPA/components/StateHandlers/Flow/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

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

// TODO: Remove handleRender and replace with only children once Chapter Prioritization is enabled.
const handleRender = () => {
Expand Down