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

Add Min Char Threshold Site Details #585

Merged
merged 2 commits into from
Jun 27, 2024
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
14 changes: 12 additions & 2 deletions src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,22 @@
setIsHeaderNavigationEnabled( true );
setDrawerActiveView( false );
if ( currentData.sitegen.siteDetails?.prompt !== '' ) {
setIsValidInput( true );
setIsFooterNavAllowed( true );
if (
currentData.sitegen.siteDetails?.prompt.length <
currentData.sitegen.siteDetails?.minCharLimit
) {
setIsValidInput( false );
setIsFooterNavAllowed( false );
currentData.sitegen.siteDetails.prompt = '';
setCurrentOnboardingData( currentData );
} else {
setIsValidInput( true );
setIsFooterNavAllowed( true );
}
return setCustomerInput( currentData.sitegen.siteDetails.prompt );
}
setIsFooterNavAllowed( false );
}, [] );

Check warning on line 75 in src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'currentData', 'setCurrentOnboardingData', 'setDrawerActiveView', 'setHeaderActiveView', 'setHideFooterNav', 'setIsFooterNavAllowed', 'setIsHeaderEnabled', 'setIsHeaderNavigationEnabled', and 'setSidebarActiveView'. Either include them or remove the dependency array

useEffect( () => {
if ( customerInput !== undefined ) {
Expand Down Expand Up @@ -90,7 +100,7 @@
setIsFooterNavAllowed( false );
}
}
}, [ customerInput ] );

Check warning on line 103 in src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'currentData', 'setCurrentOnboardingData', and 'setIsFooterNavAllowed'. Either include them or remove the dependency array

const trackPromptSetEvent = () => {
let customerInputStrengthForEvent = false;
Expand Down
Loading