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

#843 flow bug #859

Merged
merged 4 commits into from
Mar 6, 2023
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
@@ -1,4 +1,4 @@
import React, { useCallback, useContext } from 'react';
import React, { useContext } from 'react';
import { makeStyles, createStyles } from '@material-ui/core';

import FormStateContext from 'contexts/FormStateContext';
Expand Down Expand Up @@ -43,21 +43,21 @@ export default function FlowNavigation({
const backBtnTheme =
appTheme === 'dark' ? 'transparent-on-dark' : 'transparent-on-light';

const handleBack = useCallback(() => {
const handleBack = () => {
if (onBack) {
onBack();
} else {
goBackStep();
}
}, []);
};

const handleNext = useCallback(() => {
const handleNext = () => {
if (onNext) {
onNext();
} else {
goNextStep();
}
}, []);
};

return (
<div className={utilityClasses.buttonContainer}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const FormStateContextProvider = ({
if (
(suggestedNext === AppUrl.Unemployment ||
suggestedNext === AppUrl.UnemploymentPreview) &&
formState.involvement.isJobChecked
!formState.involvement.isUnemploymentChecked
) {
return getNextStep(suggestedNext);
}
Expand Down Expand Up @@ -75,6 +75,14 @@ export const FormStateContextProvider = ({
return getNextStep(suggestedNext);
}

if (
(suggestedNext === AppUrl.SomethingElse ||
suggestedNext === AppUrl.SomethingElsePreview) &&
!formState.involvement.isSomethingElseChecked
) {
return getNextStep(suggestedNext);
}

return suggestedNext;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ function InvolvementInitialFlow() {

const onCheckboxChange = (evt: React.ChangeEvent<HTMLInputElement>) => {
const { id, checked } = evt.currentTarget;
if (id === 'isNoneChecked' && checked) {
updateStepToForm({
involvement: {
isJobChecked: false,
isUnemployementChecked: false,
isRecoveryChecked: false,
isSchoolChecked: false,
isParentingChecked: false,
isCommunityChecked: false,
},
});
return;
}
const changes = {
[id]: Boolean(checked),
};
Expand Down