Skip to content

Commit

Permalink
fix: Fix appel tracker floodlight sur bonne page (#3458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintoo200 authored Nov 21, 2024
1 parent bf051f0 commit 5f423e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/pages/apprentissage-entreprises/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ export default function ApprentissageEntreprises ({ videos }: ApprentissageEntre
// eslint-disable-next-line
}, []);
const seedtagService: MarketingService = useDependency('seedtagService');
const floodlightService: MarketingService = useDependency('floodlightService');
useEffect(() => {
seedtagService.trackPage('');
floodlightService.trackPage('');
// eslint-disable-next-line
}, []);

Expand Down
3 changes: 3 additions & 0 deletions src/pages/formations/apprentissage/index.page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { DependenciesProvider } from '~/client/context/dependenciesContainer.con
import { aCommuneQuery } from '~/client/hooks/useCommuneQuery';
import { aManualAnalyticsService } from '~/client/services/analytics/analytics.service.fixture';
import { aLocalisationService } from '~/client/services/localisation/localisation.service.fixture';
import { aMarketingService } from '~/client/services/marketing/marketing.service.fixture';
import { aMetierService } from '~/client/services/metiers/metier.fixture';
import FormationAlternancePage, { getServerSideProps } from '~/pages/formations/apprentissage/index.page';
import { aGetServerSidePropsContext } from '~/server/aGetServerSidePropsContext.fixture';
Expand Down Expand Up @@ -81,6 +82,7 @@ describe('Page Formations en Apprentissage', () => {
<DependenciesProvider
analyticsService={analyticsService}
metierLbaService={aMetierService()}
floodlightService={aMarketingService()}
localisationService={aLocalisationService()}>
<FormationAlternancePage />
</DependenciesProvider>,
Expand All @@ -106,6 +108,7 @@ describe('Page Formations en Apprentissage', () => {
<DependenciesProvider
analyticsService={aManualAnalyticsService()}
metierLbaService={aMetierService()}
floodlightService={aMarketingService()}
localisationService={aLocalisationService()}>
<FormationAlternancePage resultats={resultats} />
</DependenciesProvider>,
Expand Down
9 changes: 8 additions & 1 deletion src/pages/formations/apprentissage/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import Joi from 'joi';
import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next';
import { ParsedUrlQuery } from 'querystring';
import React from 'react';
import React, { useEffect } from 'react';

import RechercherFormationAlternance
from '~/client/components/features/FormationAlternance/Rechercher/RechercherFormationAlternance';
import { useDependency } from '~/client/context/dependenciesContainer.context';
import useAnalytics from '~/client/hooks/useAnalytics';
import { MarketingService } from '~/client/services/marketing/marketing.service';
import empty from '~/client/utils/empty';
import { transformQueryToArray } from '~/pages/api/utils/joi/joi.util';
import { queryToArray } from '~/pages/api/utils/queryToArray.util';
Expand Down Expand Up @@ -36,6 +38,11 @@ type RechercherFormationApprentissagePageProps = {

export default function FormationAlternancePage(props: RechercherFormationApprentissagePageProps) {
useAnalytics(analytics);
const floodlightService: MarketingService = useDependency('floodlightService');
useEffect(() => {
floodlightService.trackPage('');
// eslint-disable-next-line
}, []);

return (
<RechercherFormationAlternance {...props} />
Expand Down

0 comments on commit 5f423e4

Please sign in to comment.