15
15
*/
16
16
17
17
import React from 'react'
18
+ import ReactGA from 'react-ga4'
18
19
import { ReactComponent as FileCode } from '../../../assets/icons/ic-file-code.svg'
19
20
import { ReactComponent as CompareIcon } from '../../../assets/icons/ic-arrows-left-right.svg'
20
21
import { ReactComponent as ReadmeIcon } from '../../../assets/icons/ic-book-open.svg'
@@ -58,6 +59,14 @@ export default function DeploymentConfigToolbar({
58
59
setConvertVariables ( ! convertVariables )
59
60
}
60
61
62
+ const handleCompareManifestClicked = ( ) => {
63
+ ReactGA . event ( {
64
+ category : 'Deployment Template' ,
65
+ action : 'Compare manifest clicked' ,
66
+ } )
67
+ handleOptionClick ( false )
68
+ }
69
+
61
70
const renderDropdownContainer = ( ) => (
62
71
< div
63
72
className = "flex-col white-background dc__position-abs bcn-0 w-204 h-72 dc__border-radius-4-imp dc__left-0 dc__border dc__zi-20 config-toolbar-dropdown-shadow"
@@ -72,7 +81,7 @@ export default function DeploymentConfigToolbar({
72
81
/>
73
82
< DropdownItem
74
83
label = "Compare generated manifest"
75
- onClick = { ( ) => handleOptionClick ( false ) }
84
+ onClick = { handleCompareManifestClicked }
76
85
index = { 2 }
77
86
isValues = { isValues }
78
87
/>
@@ -82,6 +91,14 @@ export default function DeploymentConfigToolbar({
82
91
83
92
const tippyMsg = convertVariables ? 'Hide variables values' : 'Show variables values'
84
93
94
+ const handleCompareValuesButtonClick = ( e ) => {
95
+ ReactGA . event ( {
96
+ category : 'Deployment Template' ,
97
+ action : 'Compare values clicked'
98
+ } )
99
+ changeTab ( e )
100
+ }
101
+
85
102
return (
86
103
< div className = "config-toolbar-container flex dc__content-space bcn-0 pt-8 pl-16 pr-16 dc__border-bottom" >
87
104
{ ! noReadme && showReadme ? (
@@ -100,7 +117,7 @@ export default function DeploymentConfigToolbar({
100
117
className = { `${ getTabClassName ( 2 ) } dc__position-rel` }
101
118
data-index = { 2 }
102
119
data-testid = "compare-values-tab"
103
- onClick = { changeTab }
120
+ onClick = { handleCompareValuesButtonClick }
104
121
>
105
122
< CompareIcon className = { getTabIconClass ( 2 ) } />
106
123
Compare
0 commit comments