Skip to content

Commit

Permalink
Set review stepper state to complete after user submits registration (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellemaxwell authored Mar 4, 2024
1 parent 42bfe4b commit a5e35a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/gds-user-ui/src/components/ReviewSubmit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import useCertificateStepper from 'hooks/useCertificateStepper';
import { STEPPER_NETWORK } from 'utils/constants';

import WarningBox from 'components/WarningBox';
import { setHasReachSubmitStep } from 'application/store/stepper.slice';
import { setHasReachSubmitStep, setStepStatus } from 'application/store/stepper.slice';
import { useAppDispatch } from 'application/store';
import { StepsIndexes } from 'constants/steps';
import { useFetchCertificateStep } from 'hooks/useFetchCertificateStep';
import { StepEnum } from 'types/enums';
import useSubmissionStatus from 'modules/dashboard/registration/hooks/useSubmissionStatus';
import { LSTATUS } from 'components/RegistrationForm/CertificateStepLabel';

interface ReviewSubmitProps {
onSubmitHandler: (e: React.FormEvent, network: string) => void;
Expand Down Expand Up @@ -71,6 +72,11 @@ const ReviewSubmit: React.FC<ReviewSubmitProps> = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isSent]);

// Update the review step status to complete if the user submits a registration.
if (isTestNetSubmitted || isMainNetSubmitted) {
dispatch(setStepStatus({ step: 6, status: LSTATUS.COMPLETE }));
}

const handleJumpToTrisaImplementationStep = () => {
dispatch(setHasReachSubmitStep({ hasReachSubmitStep: false }));
jumpToStep(StepsIndexes.TRISA_IMPLEMENTATION);
Expand Down

0 comments on commit a5e35a6

Please sign in to comment.