Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ephemeral error toast #2375

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: ga event on reload resource button
  • Loading branch information
shivani170 committed Jan 16, 2025
commit b0f738d218616890ca533afd2740f990e159ec14
2 changes: 1 addition & 1 deletion src/components/v2/appDetails/appDetails.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export interface NodeTreeTabListProps extends LogSearchTermType {
isReloadResourceTreeInProgress: boolean
handleReloadResourceTree: () => void
tabRef?: MutableRefObject<HTMLDivElement>
appType?: string
appType?: AppType
isExternalApp?: boolean
}

Expand Down
6 changes: 6 additions & 0 deletions src/components/v2/appDetails/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export enum ApplicationsGAEvents {
REFRESH_DEVTRON_APP_RESOURCE_TREE = 'REFRESH_DEVTRON_APP_RESOURCE_TREE',
REFRESH_HELM_APP_RESOURCE_TREE = 'REFRESH_HELM_APP_RESOURCE_TREE',
REFRESH_ARGO_APP_RESOURCE_TREE = 'REFRESH_ARGO_APP_RESOURCE_TREE',
REFRESH_FLUX_APP_RESOURCE_TREE = 'REFRESH_FLUX_APP_RESOURCE_TREE',
}
14 changes: 12 additions & 2 deletions src/components/v2/appDetails/k8Resource/NodeTreeTabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import React from 'react'
import { NavLink, useHistory, useParams } from 'react-router-dom'
import ReactGA from 'react-ga4'
import { useSharedState } from '../../utils/useSharedState'
Expand All @@ -36,13 +35,15 @@
ButtonComponentType
} from '@devtron-labs/devtron-fe-common-lib'
import './NodeTreeTabList.scss'
import { getApplicationsGAEvent } from './utils'

Check failure on line 38 in src/components/v2/appDetails/k8Resource/NodeTreeTabList.tsx

View workflow job for this annotation

GitHub Actions / ci

Module '"./utils"' has no exported member 'getApplicationsGAEvent'.

export default function NodeTreeTabList({
logSearchTerms,
setLogSearchTerms,
tabRef,
handleReloadResourceTree,
isReloadResourceTreeInProgress,
appType
}: NodeTreeTabListProps) {
const { nodeType } = useParams<{ nodeType: string }>()
const { push } = useHistory()
Expand Down Expand Up @@ -132,6 +133,15 @@
handleCloseTab(e, e.currentTarget.dataset.title)
}


const onClickReloadResourceTree = () => {
handleReloadResourceTree()
ReactGA.event({
category: getApplicationsGAEvent(appType),
action: getApplicationsGAEvent(appType),
})
}

return (
<div
data-testid="resource-tree-wrapper"
Expand Down Expand Up @@ -201,7 +211,7 @@
<Button
dataTestId="reload-resource-tree-button"
icon={<ICArrowClockwise className="scn-6" />}
onClick={handleReloadResourceTree}
onClick={onClickReloadResourceTree}
variant={ButtonVariantType.borderLess}
size={ComponentSizeType.small}
style={ButtonStyleType.neutral}
Expand Down
Loading