From 404a80c5445b323c0f1ad5e091f987e9bb5a2101 Mon Sep 17 00:00:00 2001 From: anamontiaga Date: Tue, 19 Sep 2023 17:26:22 +0200 Subject: [PATCH] recover run scenario goal --- app/layout/project/navigation/index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/layout/project/navigation/index.tsx b/app/layout/project/navigation/index.tsx index 7c19034809..8e083e5649 100644 --- a/app/layout/project/navigation/index.tsx +++ b/app/layout/project/navigation/index.tsx @@ -7,7 +7,9 @@ import Link from 'next/link'; import { useRouter } from 'next/router'; import { TippyProps } from '@tippyjs/react/headless'; +import { usePlausible } from 'next-plausible'; +import { useMe } from 'hooks/me'; import { useRunScenario, useScenario, useScenarioStatus } from 'hooks/scenarios'; import { useToasts } from 'hooks/toast'; @@ -63,7 +65,11 @@ export const Navigation = (): JSX.Element => { const isProjectRoute = route === '/projects/[pid]'; const isScenarioRoute = route.startsWith('/projects/[pid]/scenarios/'); + const { addToast } = useToasts(); + const plausible = usePlausible(); + + const { data: user } = useMe(); const [submenuState, setSubmenuState] = useState<{ [key in NavigationTreeCategories]: boolean }>({ user: false, @@ -122,6 +128,12 @@ export const Navigation = (): JSX.Element => { level: 'success', } ); + plausible('Run scenario', { + props: { + userId: `${user.id}`, + userEmail: `${user.email}`, + }, + }); }, onError: () => { addToast(