Skip to content

Commit a5a4c30

Browse files
authored
Resolves: MTV-3619 | [UI] 'Plan wizard step visited' telemetry not triggered when 'Skip to review' button is clicked (#2073)
Signed-off-by: Jeff Puzzo <[email protected]>
1 parent 260209e commit a5a4c30

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plans/create/CreatePlanWizardFooter.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
type WizardFooterProps,
1212
WizardFooterWrapper,
1313
} from '@patternfly/react-core';
14+
import { TELEMETRY_EVENTS } from '@utils/analytics/constants';
15+
import { useForkliftAnalytics } from '@utils/analytics/hooks/useForkliftAnalytics';
1416
import { useForkliftTranslation } from '@utils/i18n';
1517

1618
import { useCreatePlanFormContext } from './hooks/useCreatePlanFormContext';
@@ -36,6 +38,7 @@ const CreatePlanWizardFooter: FC<CreatePlanWizardFooterProps> = ({
3638
} = useCreatePlanFormContext();
3739
const { validateStep } = useStepValidation();
3840
const { activeStep, goToNextStep, goToPrevStep, goToStepById } = useWizardContext();
41+
const { trackEvent } = useForkliftAnalytics();
3942

4043
const canSkipToReview = useMemo(
4144
() =>
@@ -65,8 +68,11 @@ const CreatePlanWizardFooter: FC<CreatePlanWizardFooterProps> = ({
6568
const isValid = await validateStep(activeStep.id as PlanWizardStepId);
6669
if (isValid) {
6770
goToStepById(PlanWizardStepId.ReviewAndCreate);
71+
trackEvent(TELEMETRY_EVENTS.PLAN_WIZARD_STEP_VISITED, {
72+
stepId: PlanWizardStepId.ReviewAndCreate,
73+
});
6874
}
69-
}, [validateStep, activeStep.id, goToStepById]);
75+
}, [validateStep, activeStep.id, goToStepById, trackEvent]);
7076

7177
const onCancel = useCallback(() => {
7278
if (location.state?.sourceProvider) {

0 commit comments

Comments
 (0)