Skip to content

Commit e4b11d9

Browse files
Merge pull request #1522 from devtron-labs/fixes/dependency-add-ga
fix: GA and Qa bugs in app-dependency
2 parents 98e82df + 58209fd commit e4b11d9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/components/app/Overview/Overview.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { EnvironmentList } from './EnvironmentList'
3535
import { MAX_LENGTH_350 } from '../../../config/constantMessaging'
3636
import { getModuleInfo } from '../../v2/devtronStackManager/DevtronStackManager.service'
3737
import { MODAL_STATE, OVERVIEW_TABS, TAB_SEARCH_KEY } from './constants'
38+
import ReactGA from 'react-ga4'
3839
const MandatoryTagWarning = importComponentFromFELibrary('MandatoryTagWarning')
3940
const Catalog = importComponentFromFELibrary('Catalog')
4041
const DependencyList = importComponentFromFELibrary('DependencyList')
@@ -87,6 +88,15 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
8788
history.replace({ search: searchParams.toString() })
8889
}
8990

91+
const handleEditDependencyClick = () => {
92+
ReactGA.event({
93+
category: 'Application Dependency',
94+
action: 'Edit Dependency click',
95+
label: 'Edit Dependency click',
96+
})
97+
toggleUpdateDependencyModal()
98+
}
99+
90100
useEffect(() => {
91101
// add a default tab if not set
92102
if (!activeTab || !Object.values(OVERVIEW_TABS).includes(activeTab)) {
@@ -481,6 +491,7 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
481491
isUpdateModalOpen={isUpdateDependencyModalOpen}
482492
toggleUpdateModalOpen={toggleUpdateDependencyModal}
483493
toggleButtonDisabledState={setIsEditDependencyButtonDisabled}
494+
filteredEnvIds={filteredEnvIds}
484495
/>
485496
) : null,
486497
}
@@ -507,7 +518,7 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
507518
<button
508519
type="button"
509520
className={`cta flex h-28 dc__gap-4 ${isEditDependencyButtonDisabled ? 'disabled-opacity' : ''}`}
510-
onClick={isEditDependencyButtonDisabled ? noop : toggleUpdateDependencyModal}
521+
onClick={isEditDependencyButtonDisabled ? noop : handleEditDependencyClick}
511522
>
512523
<EditIcon className="mw-14 icon-dim-14 scn-0 dc__no-svg-fill" />
513524
Edit Dependency

0 commit comments

Comments
 (0)