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: telemetry event fixes #2443

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 9 additions & 9 deletions src/components/onboardingGuide/OnboardingGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

import React, { useEffect } from 'react'
import { NavLink } from 'react-router-dom'
import { AppListConstants, ModuleNameMap } from '@devtron-labs/devtron-fe-common-lib'
import { AppListConstants, ModuleNameMap, handlePostHogEventUpdate } from '@devtron-labs/devtron-fe-common-lib'

Check failure on line 19 in src/components/onboardingGuide/OnboardingGuide.tsx

View workflow job for this annotation

GitHub Actions / ci

Module '"@devtron-labs/devtron-fe-common-lib"' has no exported member 'handlePostHogEventUpdate'.
import HelmCollage from '../../assets/img/guided-helm-collage.png'
import HelmCluster from '../../assets/img/guided-helm-cluster.png'
import DeployCICD from '../../assets/img/guide-onboard.png'
import { SERVER_MODE, URLS } from '../../config'
import { ReactComponent as ArrowRight } from '../../assets/icons/ic-arrow-right.svg'
import { handlePostHogEventUpdate, LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from './onboarding.utils'
import { LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from './onboarding.utils'
import GuideCommonHeader from './GuideCommonHeader'
import { OnboardingGuideProps } from './OnboardingGuide.type'
import { updateLoginCount } from '../../services/service'
Expand Down Expand Up @@ -55,19 +55,19 @@
: `${URLS.STACK_MANAGER_DISCOVER_MODULES_DETAILS}?id=${ModuleNameMap.CICD}`
}

const onClickHelmChart = (e) => {
handlePostHogEventUpdate(e, POSTHOG_EVENT_ONBOARDING.BROWSE_HELM_CHART)
const onClickHelmChart = () => {
handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.BROWSE_HELM_CHART)
}

const onClickCluster = (e) => {
handlePostHogEventUpdate(e, POSTHOG_EVENT_ONBOARDING.CONNECT_CLUSTER)
const onClickCluster = () => {
handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.CONNECT_CLUSTER)
}

const onClickedCICD = (e) => {
const onClickedCICD = () => {
if (serverMode === SERVER_MODE.FULL) {
handlePostHogEventUpdate(e, POSTHOG_EVENT_ONBOARDING.DEPLOY_CUSTOM_APP_CI_CD)
handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.DEPLOY_CUSTOM_APP_CI_CD)
} else {
handlePostHogEventUpdate(e, POSTHOG_EVENT_ONBOARDING.INSTALL_CUSTOM_CI_CD)
handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.INSTALL_CUSTOM_CI_CD)
}
}

Expand Down
10 changes: 0 additions & 10 deletions src/components/onboardingGuide/onboarding.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { updatePostHogEvent } from '../../services/service'

Check failure on line 17 in src/components/onboardingGuide/onboarding.utils.ts

View workflow job for this annotation

GitHub Actions / ci

Module '"../../services/service"' has no exported member 'updatePostHogEvent'.

export const POSTHOG_EVENT_ONBOARDING = {
PREVIEW: 'Preview',
Expand All @@ -34,13 +34,3 @@

export const MAX_LOGIN_COUNT = 5

export const handlePostHogEventUpdate = (e, eventName?: string): void => {
const payload = {
eventType: eventName || e.target?.dataset.posthog,
key: LOGIN_COUNT,
value: '',
active: true,
}
updatePostHogEvent(payload)
}

1 change: 0 additions & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ export const Routes = {
NODE_LIST: 'k8s/capacity/node/list',
TAINTS_EDIT: 'k8s/capacity/node/taints/edit',
HELM_APP_TEMPLATE_CHART: 'application/template-chart',
TELEMETRY_EVENT: 'telemetry/event',
DEPLOYMENT_STATUS: 'app/deployment-status/timeline',
HELM_DEPLOYMENT_STATUS_TIMELINE_INSTALLED_APP: 'app-store/deployment-status/timeline',
MANUAL_SYNC: 'app/deployment-status/manual-sync',
Expand Down
4 changes: 0 additions & 4 deletions src/services/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,6 @@ export function updateLoginCount(payload): Promise<LoginCountType> {
return post(`${Routes.ATTRIBUTES_USER}/${Routes.UPDATE}`, payload)
}

export function updatePostHogEvent(payload): Promise<ResponseType> {
return post(Routes.TELEMETRY_EVENT, payload)
}

export const validateContainerConfiguration = (request: any): Promise<any> => {
const URL = `${Routes.DOCKER_REGISTRY_CONFIG}/validate`
return post(URL, request)
Expand Down
Loading