feat(editor): Add node_id to canvas events (no-changelog) (#13120)

This commit is contained in:
Milorad FIlipović 2025-02-07 10:55:34 +01:00 committed by GitHub
parent 2b1eb049f2
commit 94789e0309
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 0 deletions

View file

@ -628,6 +628,7 @@ watch(
); );
telemetry.track('User opened node modal', { telemetry.track('User opened node modal', {
node_id: activeNode.value?.id,
node_type: activeNodeType.value ? activeNodeType.value?.name : '', node_type: activeNodeType.value ? activeNodeType.value?.name : '',
workflow_id: workflowsStore.workflowId, workflow_id: workflowsStore.workflowId,
push_ref: pushRef.value, push_ref: pushRef.value,

View file

@ -743,6 +743,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
function trackAddDefaultNode(nodeData: INodeUi, options: AddNodeOptions) { function trackAddDefaultNode(nodeData: INodeUi, options: AddNodeOptions) {
nodeCreatorStore.onNodeAddedToCanvas({ nodeCreatorStore.onNodeAddedToCanvas({
node_id: nodeData.id,
node_type: nodeData.type, node_type: nodeData.type,
node_version: nodeData.typeVersion, node_version: nodeData.typeVersion,
is_auto_add: options.isAutoAdd, is_auto_add: options.isAutoAdd,

View file

@ -18,6 +18,7 @@ const mode = 'mode';
const now = 1717602004819; const now = 1717602004819;
const now1 = 1718602004819; const now1 = 1718602004819;
const node_type = 'node-type'; const node_type = 'node-type';
const node_id = 'node-id';
const node_version = 1; const node_version = 1;
const input_node_type = 'input-node-type'; const input_node_type = 'input-node-type';
const action = 'action'; const action = 'action';
@ -164,6 +165,7 @@ describe('useNodeCreatorStore', () => {
workflow_id, workflow_id,
}); });
nodeCreatorStore.onNodeAddedToCanvas({ nodeCreatorStore.onNodeAddedToCanvas({
node_id,
node_type, node_type,
node_version, node_version,
is_auto_add: true, is_auto_add: true,
@ -175,6 +177,7 @@ describe('useNodeCreatorStore', () => {
expect(useTelemetry().track).toHaveBeenCalledWith( expect(useTelemetry().track).toHaveBeenCalledWith(
'User added node to workflow canvas', 'User added node to workflow canvas',
{ {
node_id,
node_type, node_type,
node_version, node_version,
is_auto_add: true, is_auto_add: true,

View file

@ -355,6 +355,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
} }
function onNodeAddedToCanvas(properties: { function onNodeAddedToCanvas(properties: {
node_id: string;
node_type: string; node_type: string;
node_version: number; node_version: number;
is_auto_add?: boolean; is_auto_add?: boolean;

View file

@ -2429,6 +2429,7 @@ export default defineComponent({
} else { } else {
void this.externalHooks.run('nodeView.addNodeButton', { nodeTypeName }); void this.externalHooks.run('nodeView.addNodeButton', { nodeTypeName });
this.nodeCreatorStore.onNodeAddedToCanvas({ this.nodeCreatorStore.onNodeAddedToCanvas({
node_id: newNodeData.id,
node_type: nodeTypeName, node_type: nodeTypeName,
node_version: newNodeData.typeVersion, node_version: newNodeData.typeVersion,
is_auto_add: isAutoAdd, is_auto_add: isAutoAdd,