mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
refactor(editor): Add telemetry for debug in editor (no-changelog) (#8073)
https://linear.app/n8n/issue/PAY-1142
This commit is contained in:
parent
a63d94f28c
commit
d44602913f
|
@ -373,6 +373,7 @@ export interface IExecutionPushResponse {
|
||||||
|
|
||||||
export interface IExecutionResponse extends IExecutionBase {
|
export interface IExecutionResponse extends IExecutionBase {
|
||||||
id: string;
|
id: string;
|
||||||
|
status: string;
|
||||||
data?: IRunExecutionData;
|
data?: IRunExecutionData;
|
||||||
workflowData: IWorkflowDb;
|
workflowData: IWorkflowDb;
|
||||||
executedNode?: string;
|
executedNode?: string;
|
||||||
|
|
|
@ -13,8 +13,12 @@ import type { INodeUi } from '@/Interface';
|
||||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||||
import { useSettingsStore } from '@/stores/settings.store';
|
import { useSettingsStore } from '@/stores/settings.store';
|
||||||
import { useUIStore } from '@/stores/ui.store';
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
|
import { useTelemetry } from './useTelemetry';
|
||||||
|
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||||
|
|
||||||
export const useExecutionDebugging = () => {
|
export const useExecutionDebugging = () => {
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
|
@ -92,17 +96,22 @@ export const useExecutionDebugging = () => {
|
||||||
workflowsStore.setWorkflowExecutionData(execution);
|
workflowsStore.setWorkflowExecutionData(execution);
|
||||||
|
|
||||||
// Pin data of all nodes which do not have a parent node
|
// Pin data of all nodes which do not have a parent node
|
||||||
workflowNodes
|
const pinnableNodes = workflowNodes.filter(
|
||||||
.filter((node: INodeUi) => !workflow.getParentNodes(node.name).length)
|
(node: INodeUi) => !workflow.getParentNodes(node.name).length,
|
||||||
.forEach((node: INodeUi) => {
|
);
|
||||||
const nodeData = runData[node.name]?.[0].data?.main[0];
|
|
||||||
if (nodeData) {
|
let pinnings = 0;
|
||||||
workflowsStore.pinData({
|
|
||||||
node,
|
pinnableNodes.forEach((node: INodeUi) => {
|
||||||
data: nodeData,
|
const nodeData = runData[node.name]?.[0].data?.main[0];
|
||||||
});
|
if (nodeData) {
|
||||||
}
|
pinnings++;
|
||||||
});
|
workflowsStore.pinData({
|
||||||
|
node,
|
||||||
|
data: nodeData,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
toast.showToast({
|
toast.showToast({
|
||||||
title: i18n.baseText('nodeView.showMessage.debug.title'),
|
title: i18n.baseText('nodeView.showMessage.debug.title'),
|
||||||
|
@ -119,6 +128,13 @@ export const useExecutionDebugging = () => {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
telemetry.track('User clicked debug execution button', {
|
||||||
|
instance_id: useRootStore().instanceId,
|
||||||
|
exec_status: execution.status,
|
||||||
|
override_pinned_data: pinnableNodes.length === pinnings,
|
||||||
|
all_exec_data_imported: missingNodeNames.length === 0,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDebugLinkClick = (event: Event): void => {
|
const handleDebugLinkClick = (event: Event): void => {
|
||||||
|
|
Loading…
Reference in a new issue