From 332796f60d8b3f8d98cfe2d546e1dfd5e7d508b9 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 18 Apr 2023 13:29:48 +0200 Subject: [PATCH] Add analytics event for installation method tab click Fix analytics event action --- .../InstallationWizard/InstallStep/index.tsx | 5 +++-- .../InstallationWizard/InstallStep/types.ts | 1 + src/components/InstallationWizard/index.tsx | 18 ++++++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/components/InstallationWizard/InstallStep/index.tsx b/src/components/InstallationWizard/InstallStep/index.tsx index 72b68e36c..7ef7b9645 100644 --- a/src/components/InstallationWizard/InstallStep/index.tsx +++ b/src/components/InstallationWizard/InstallStep/index.tsx @@ -46,8 +46,9 @@ export const InstallStep = (props: InstallStepProps) => { props.onGoToNextStep(); }; - const handleSelectInstallTab = (tabIndex: number) => { + const handleInstallTabSelect = (tabIndex: number) => { setSelectedInstallTab(tabIndex); + props.onInstallTabSelect(installTabs[tabIndex].title); }; const handleSelectDockerComposeOSTab = (tabIndex: number) => { @@ -167,7 +168,7 @@ export const InstallStep = (props: InstallStepProps) => { diff --git a/src/components/InstallationWizard/InstallStep/types.ts b/src/components/InstallationWizard/InstallStep/types.ts index 1a3976b44..2a5f73f08 100644 --- a/src/components/InstallationWizard/InstallStep/types.ts +++ b/src/components/InstallationWizard/InstallStep/types.ts @@ -5,5 +5,6 @@ export interface InstallStepProps { onConnectionStatusCheck: () => void; onResetConnectionCheckStatus: () => void; onGetDigmaDockerDesktopButtonClick: () => void; + onInstallTabSelect: (tabName: string) => void; onGoToNextStep: () => void; } diff --git a/src/components/InstallationWizard/index.tsx b/src/components/InstallationWizard/index.tsx index 947b9c9ba..bb5bd5c87 100644 --- a/src/components/InstallationWizard/index.tsx +++ b/src/components/InstallationWizard/index.tsx @@ -46,7 +46,8 @@ const trackingEvents = addPrefix( INSTALL_STEP_AUTOMATICALLY_PASSED: "install step automatically passed", GET_DIGMA_DOCKER_EXTENSION_BUTTON_CLICKED: "get digma docker extension button clicked", - OBSERVABILITY_BUTTON_CLICKED: "set observability button clicked" + OBSERVABILITY_BUTTON_CLICKED: "set observability button clicked", + TAB_CLICKED: "tab clicked" }, " " ); @@ -136,13 +137,25 @@ export const InstallationWizard = () => { } }); window.sendMessageToDigma({ - action: globalActions.SET_TRACKING_EVENT, + action: globalActions.SEND_TRACKING_EVENT, payload: { eventName: trackingEvents.GET_DIGMA_DOCKER_EXTENSION_BUTTON_CLICKED } }); }; + const handleInstallTabSelect = (tabName: string) => { + window.sendMessageToDigma({ + action: globalActions.SEND_TRACKING_EVENT, + payload: { + eventName: trackingEvents.TAB_CLICKED, + data: { + tabName + } + } + }); + }; + const handleIsAlreadyUsingOtelChange = (value: boolean) => { setIsAlreadyUsingOtel(value); }; @@ -200,6 +213,7 @@ export const InstallationWizard = () => { onGetDigmaDockerDesktopButtonClick={ handleGetDigmaDockerDesktopButtonClick } + onInstallTabSelect={handleInstallTabSelect} onGoToNextStep={goToNextStep} /> )