diff --git a/app/client/src/ce/utils/analyticsUtilTypes.ts b/app/client/src/ce/utils/analyticsUtilTypes.ts index c1c7b5dde2..034634c814 100644 --- a/app/client/src/ce/utils/analyticsUtilTypes.ts +++ b/app/client/src/ce/utils/analyticsUtilTypes.ts @@ -293,6 +293,9 @@ export type EventName = | "TEST_DATA_SOURCE_FAILED" | "DATASOURCE_SCHEMA_FETCH" | "SWITCH_ENVIRONMENT" + | "DEPLOY_WITH_GIT_DISMISS_ENV_MESSAGE" + | "CANCEL_DEPLOY_WITHOUT_GIT" + | "DEPLOY_WITHOUT_GIT_DISMISS_ENV_MESSAGE" | "EDIT_ACTION_CLICK" | "QUERY_TEMPLATE_SELECTED" | "RUN_API_FAILURE" diff --git a/app/client/src/pages/Editor/DataSourceEditor/index.tsx b/app/client/src/pages/Editor/DataSourceEditor/index.tsx index 050e5e039e..6aabacbf5e 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/index.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/index.tsx @@ -95,6 +95,7 @@ import { onUpdateFilterSuccess, } from "@appsmith/utils/Environments"; import type { CalloutKind } from "design-system"; +import AnalyticsUtil from "utils/AnalyticsUtil"; interface ReduxStateProps { canCreateDatasourceActions: boolean; @@ -610,7 +611,13 @@ class DatasourceEditorRouter extends React.Component { }, }); } - + AnalyticsUtil.logEvent("SWITCH_ENVIRONMENT", { + fromEnvId: this.state.filterParams.id, + toEnvId: id, + fromEnvName: this.state.filterParams.name, + toEnvName: name, + mode: "CONFIGURATION", + }); // This is the event that changes the filter and updates the datasource this.setState({ filterParams: { diff --git a/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx b/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx index 0d8115d91a..a1a676e3ac 100644 --- a/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx +++ b/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx @@ -87,6 +87,7 @@ import { getQueryParams } from "utils/URLUtils"; import GoogleSheetSchema from "./GoogleSheetSchema"; import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag"; import { selectFeatureFlagCheck } from "@appsmith/selectors/featureFlagsSelectors"; +import AnalyticsUtil from "utils/AnalyticsUtil"; const ViewModeContainer = styled.div` display: flex; @@ -340,6 +341,14 @@ class DatasourceSaaSEditor extends JSONtoForm { this.state.filterParams.showFilterPane === showFilterPane ) return false; + + AnalyticsUtil.logEvent("SWITCH_ENVIRONMENT", { + fromEnvId: this.state.filterParams.id, + toEnvId: id, + fromEnvName: this.state.filterParams.name, + toEnvName: name, + mode: "CONFIGURATION", + }); this.setState({ filterParams: { id,