diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/elements/ruleList/ruleItem/plain/ruleItem.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/elements/ruleList/ruleItem/plain/ruleItem.jsx index f9164a7a33..d66d2c0113 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/elements/ruleList/ruleItem/plain/ruleItem.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/elements/ruleList/ruleItem/plain/ruleItem.jsx @@ -15,12 +15,10 @@ */ import React, { useState } from 'react'; -import { useTracking } from 'react-tracking'; import classNames from 'classnames/bind'; import Parser from 'html-react-parser'; import { Toggle } from 'componentLibrary/toggle'; import PropTypes from 'prop-types'; -import { PROJECT_SETTINGS_PATTERN_ANALYSIS_EVENTS } from 'analyticsEvents/projectSettingsPageEvents'; import { ruleItemPropTypes, ruleItemDefaultProps } from './propTypes'; import styles from './ruleItem.scss'; @@ -36,7 +34,6 @@ export const RuleItem = ({ onRuleNameClick, isPreview, }) => { - const { trackEvent } = useTracking(); const [shown, setShown] = useState(false); const { enabled, name } = item; const isRuleNameClickable = Boolean(onRuleNameClick); @@ -50,9 +47,6 @@ export const RuleItem = ({ } const onClickHandler = () => { - if (!shown) { - trackEvent(PROJECT_SETTINGS_PATTERN_ANALYSIS_EVENTS.OPEN_NAME_PATTERN_ANALYSIS); - } onClick(!shown); setShown(!shown); }; diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysisContent/patternAnalysisContent.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysisContent/patternAnalysisContent.jsx index 1a16c723fd..ac0973487d 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysisContent/patternAnalysisContent.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/patternAnalysis/patternAnalysisContent/patternAnalysisContent.jsx @@ -177,6 +177,12 @@ export const PatternAnalysisContent = ({ }, ]; + const handleRuleItemClick = (isShown) => { + if (isShown) { + trackEvent(PROJECT_SETTINGS_PATTERN_ANALYSIS_EVENTS.OPEN_NAME_PATTERN_ANALYSIS); + } + }; + return ( <>