From ff2fe05e138a50e595826996d1be3be284a54131 Mon Sep 17 00:00:00 2001 From: Dzmitry Kosarau Date: Mon, 13 Nov 2023 12:45:23 +0500 Subject: [PATCH] EPMRPP-87583 || Add missing GA4 events --- .../ga4Events/projectSettingsPageEvents.js | 2 +- .../integrationHeader/integrationHeader.jsx | 24 +++++++++++++++---- .../integrationInfo/integrationInfo.jsx | 2 +- .../integrationsList/integrationsList.jsx | 2 +- .../patternAnalysis/patternAnalysis.jsx | 2 +- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js b/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js index 97290a0e8e..81c713041c 100644 --- a/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js +++ b/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js @@ -183,7 +183,7 @@ export const PROJECT_SETTINGS_DEFECT_TYPES_EVENTS = { }; export const PROJECT_SETTINGS_INTEGRATION = { - CLICK_DOCUMENTATION_BUTTON: (place) => ({ + clickDocumentationLink: (place) => ({ ...BASIC_EVENT_PARAMETERS_INTEGRATIONS, place: normalizeEventString(place), link_name: 'documentation', diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationHeader/integrationHeader.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationHeader/integrationHeader.jsx index 5a91a2692b..fd511aa458 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationHeader/integrationHeader.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationHeader/integrationHeader.jsx @@ -25,6 +25,9 @@ import { PLUGIN_DESCRIPTIONS_MAP } from 'components/integrations/messages'; import { PluginIcon } from 'components/integrations/elements/pluginIcon'; import { Breadcrumbs } from 'componentLibrary/breadcrumbs'; import { createExternalLink } from 'common/utils'; +import { PROJECT_SETTINGS_INTEGRATION } from 'analyticsEvents/projectSettingsPageEvents'; +import { FormattedDescription } from 'pages/inside/projectSettingsPageContainer/content/elements'; +import { useTracking } from 'react-tracking'; import styles from './integrationHeader.scss'; import { messages } from '../messages'; @@ -32,6 +35,7 @@ const cx = classNames.bind(styles); export const IntegrationHeader = (props) => { const { formatMessage } = useIntl(); + const { trackEvent } = useTracking(); const { data: { name, details = {} }, data, @@ -45,19 +49,29 @@ export const IntegrationHeader = (props) => { const { documentationLink = '' } = details; + const handleDocumentationClick = () => { + trackEvent(PROJECT_SETTINGS_INTEGRATION.clickDocumentationLink('integrations')); + }; + const integrationDescription = PLUGIN_DESCRIPTIONS_MAP[name] ? ( <> {PLUGIN_DESCRIPTIONS_MAP[name]}{' '} - {Parser( - formatMessage(messages.linkToDocumentation, { + createExternalLink(link, documentationLink), - }), - )} + })} + event={PROJECT_SETTINGS_INTEGRATION.clickDocumentationLink('integrations')} + /> ) : ( <> {details.description && Parser(details.description)} Link to{' '} - + Documentation diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationInfo.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationInfo.jsx index f75db6fce3..f94f0ed2c7 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationInfo.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationInfo.jsx @@ -238,7 +238,7 @@ export const IntegrationInfo = (props) => { }; const handleDocumentationClick = () => { - trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_DOCUMENTATION_BUTTON('integrations')); + trackEvent(PROJECT_SETTINGS_INTEGRATION.clickDocumentationLink('integrations')); }; const renderIntegrationList = () => ( diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationsList.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationsList.jsx index 36cb997bef..6aaf310093 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationsList.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationsList.jsx @@ -34,7 +34,7 @@ export const IntegrationsList = (props) => { const { trackEvent } = useTracking(); const handleDocumentationClick = () => { - trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_DOCUMENTATION_BUTTON('no_integrations')); + trackEvent(PROJECT_SETTINGS_INTEGRATION.clickDocumentationLink('no_integrations')); }; return ( diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysis.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysis.jsx index f2c2c2c49e..87424eaf90 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysis.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysis.jsx @@ -75,7 +75,7 @@ export const PatternAnalysis = ({ setHeaderTitleNode }) => { const handleDocumentationClick = () => { trackEvent( - PROJECT_SETTINGS_PATTERN_ANALYSIS_EVENTS.CLICK_LINK_DOCUMENTATION('no_pattern_analysis'), + PROJECT_SETTINGS_PATTERN_ANALYSIS_EVENTS.clickDocumentationLink('no_pattern_analysis'), ); };