mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
feat(editor): Add node_id
to canvas events (no-changelog) (#13120)
This commit is contained in:
parent
2b1eb049f2
commit
94789e0309
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue