Skip to content

Commit

Permalink
EPMRPP-87583 || Add missing GA4 events
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzmitry Kosarau authored and Dzmitry Kosarau committed Nov 13, 2023
1 parent 13902f3 commit ff2fe05
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ 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';

const cx = classNames.bind(styles);

export const IntegrationHeader = (props) => {
const { formatMessage } = useIntl();
const { trackEvent } = useTracking();
const {
data: { name, details = {} },
data,
Expand All @@ -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, {
<FormattedDescription
content={formatMessage(messages.linkToDocumentation, {
a: (link) => createExternalLink(link, documentationLink),
}),
)}
})}
event={PROJECT_SETTINGS_INTEGRATION.clickDocumentationLink('integrations')}
/>
</>
) : (
<>
{details.description && Parser(details.description)} Link to{' '}
<a target="_blank" rel="noreferrer noopener" href={documentationLink}>
<a
onClick={handleDocumentationClick}
target="_blank"
rel="noreferrer noopener"
href={documentationLink}
>
Documentation
</a>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
);
};

Expand Down

0 comments on commit ff2fe05

Please sign in to comment.