chore: Add analytic events for show bindings pane (#17174)

This commit is contained in:
Hetu Nandu 2022-09-29 14:13:30 +05:30 committed by GitHub
parent ce1f42f786
commit f56e9a2aba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import styled from "styled-components";
import { ControlIcons } from "icons/ControlIcons";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import { JSCollectionData } from "reducers/entityReducers/jsActionsReducer";
import AnalyticsUtil from "utils/AnalyticsUtil";
const CloseIcon = ControlIcons.CLOSE_CONTROL;
@ -64,6 +65,15 @@ export function EntityProperties() {
return () => document.removeEventListener("click", handleOutsideClick);
}, [show]);
useEffect(() => {
if (entityId) {
AnalyticsUtil.logEvent("SHOW_BINDINGS_TRIGGERED", {
entityName,
entityType,
});
}
}, [entityId]);
const actionEntity = useSelector((state: AppState) =>
state.entities.actions.find((action) => action.config.id === entityId),
);
@ -132,6 +142,7 @@ export function EntityProperties() {
propertyName: actionProperty,
entityName: jsCollection.config.name,
value: value,
entityType,
};
},
);
@ -166,6 +177,7 @@ export function EntityProperties() {
propertyName: actionProperty,
entityName: entityName,
value,
entityType,
};
});
}
@ -192,6 +204,7 @@ export function EntityProperties() {
propertyName: widgetProperty,
entityName: entity.widgetName,
value: entity[widgetProperty],
entityType,
};
});
break;

View File

@ -15,6 +15,7 @@ import { COPY_ELEMENT, createMessage } from "@appsmith/constants/messages";
import { TOOLTIP_HOVER_ON_DELAY } from "constants/AppConstants";
import CollapseToggle from "./CollapseToggle";
import { ReactComponent as CopyIcon } from "assets/icons/menu/copy-snippet.svg";
import AnalyticsUtil from "utils/AnalyticsUtil";
const Wrapper = styled.div<{ step: number }>`
&&&& {
@ -140,6 +141,10 @@ export const EntityProperty = memo((props: any) => {
const isString = typeof props.value === "string";
const copyBindingToClipboard = () => {
AnalyticsUtil.logEvent("BINDING_COPIED", {
entityType: props.entityType,
codeText,
});
write(codeText);
};

View File

@ -261,7 +261,9 @@ export type EventName =
| "PRETTIFY_CODE_KEYBOARD_SHORTCUT"
| "JS_OBJECT_CREATED"
| "JS_OBJECT_FUNCTION_ADDED"
| "JS_OBJECT_FUNCTION_RUN";
| "JS_OBJECT_FUNCTION_RUN"
| "SHOW_BINDINGS_TRIGGERED"
| "BINDING_COPIED";
function getApplicationId(location: Location) {
const pathSplit = location.pathname.split("/");