mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Send evaluation telemetry event to Posthog (#16040)
This commit is contained in:
@@ -105,22 +105,30 @@ watch(
|
|||||||
(ready) => {
|
(ready) => {
|
||||||
if (ready) {
|
if (ready) {
|
||||||
if (showWizard.value) {
|
if (showWizard.value) {
|
||||||
telemetry.track('User viewed tests tab', {
|
telemetry.track(
|
||||||
workflow_id: props.name,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'setup',
|
workflow_id: props.name,
|
||||||
trigger_set_up: evaluationStore.evaluationTriggerExists,
|
test_type: 'evaluation',
|
||||||
output_set_up: evaluationStore.evaluationSetOutputsNodeExist,
|
view: 'setup',
|
||||||
metrics_set_up: evaluationStore.evaluationSetMetricsNodeExist,
|
trigger_set_up: evaluationStore.evaluationTriggerExists,
|
||||||
quota_reached: evaluationsQuotaExceeded.value,
|
output_set_up: evaluationStore.evaluationSetOutputsNodeExist,
|
||||||
});
|
metrics_set_up: evaluationStore.evaluationSetMetricsNodeExist,
|
||||||
|
quota_reached: evaluationsQuotaExceeded.value,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
telemetry.track('User viewed tests tab', {
|
telemetry.track(
|
||||||
workflow_id: props.name,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'overview',
|
workflow_id: props.name,
|
||||||
run_count: runs.value.length,
|
test_type: 'evaluation',
|
||||||
});
|
view: 'overview',
|
||||||
|
run_count: runs.value.length,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -143,15 +143,19 @@ describe('EvaluationsRootView', () => {
|
|||||||
renderComponent({ props: { name: mockWorkflow.id } });
|
renderComponent({ props: { name: mockWorkflow.id } });
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(useTelemetry().track).toHaveBeenCalledWith('User viewed tests tab', {
|
expect(useTelemetry().track).toHaveBeenCalledWith(
|
||||||
workflow_id: mockWorkflow.id,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'setup',
|
workflow_id: mockWorkflow.id,
|
||||||
trigger_set_up: false,
|
test_type: 'evaluation',
|
||||||
output_set_up: false,
|
view: 'setup',
|
||||||
metrics_set_up: false,
|
trigger_set_up: false,
|
||||||
quota_reached: false,
|
output_set_up: false,
|
||||||
});
|
metrics_set_up: false,
|
||||||
|
quota_reached: false,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -171,12 +175,16 @@ describe('EvaluationsRootView', () => {
|
|||||||
renderComponent({ props: { name: mockWorkflow.id } });
|
renderComponent({ props: { name: mockWorkflow.id } });
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(useTelemetry().track).toHaveBeenCalledWith('User viewed tests tab', {
|
expect(useTelemetry().track).toHaveBeenCalledWith(
|
||||||
workflow_id: mockWorkflow.id,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'overview',
|
workflow_id: mockWorkflow.id,
|
||||||
run_count: 2,
|
test_type: 'evaluation',
|
||||||
});
|
view: 'overview',
|
||||||
|
run_count: 2,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -212,15 +220,19 @@ describe('EvaluationsRootView', () => {
|
|||||||
renderComponent({ props: { name: mockWorkflow.id } });
|
renderComponent({ props: { name: mockWorkflow.id } });
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(useTelemetry().track).toHaveBeenCalledWith('User viewed tests tab', {
|
expect(useTelemetry().track).toHaveBeenCalledWith(
|
||||||
workflow_id: mockWorkflow.id,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'setup',
|
workflow_id: mockWorkflow.id,
|
||||||
trigger_set_up: true,
|
test_type: 'evaluation',
|
||||||
output_set_up: false,
|
view: 'setup',
|
||||||
metrics_set_up: false,
|
trigger_set_up: true,
|
||||||
quota_reached: false,
|
output_set_up: false,
|
||||||
});
|
metrics_set_up: false,
|
||||||
|
quota_reached: false,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -262,15 +274,19 @@ describe('EvaluationsRootView', () => {
|
|||||||
renderComponent({ props: { name: mockWorkflow.id } });
|
renderComponent({ props: { name: mockWorkflow.id } });
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(useTelemetry().track).toHaveBeenCalledWith('User viewed tests tab', {
|
expect(useTelemetry().track).toHaveBeenCalledWith(
|
||||||
workflow_id: mockWorkflow.id,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'setup',
|
workflow_id: mockWorkflow.id,
|
||||||
trigger_set_up: false,
|
test_type: 'evaluation',
|
||||||
output_set_up: true,
|
view: 'setup',
|
||||||
metrics_set_up: false,
|
trigger_set_up: false,
|
||||||
quota_reached: false,
|
output_set_up: true,
|
||||||
});
|
metrics_set_up: false,
|
||||||
|
quota_reached: false,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -312,15 +328,19 @@ describe('EvaluationsRootView', () => {
|
|||||||
renderComponent({ props: { name: mockWorkflow.id } });
|
renderComponent({ props: { name: mockWorkflow.id } });
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(useTelemetry().track).toHaveBeenCalledWith('User viewed tests tab', {
|
expect(useTelemetry().track).toHaveBeenCalledWith(
|
||||||
workflow_id: mockWorkflow.id,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'setup',
|
workflow_id: mockWorkflow.id,
|
||||||
trigger_set_up: false,
|
test_type: 'evaluation',
|
||||||
output_set_up: false,
|
view: 'setup',
|
||||||
metrics_set_up: true,
|
trigger_set_up: false,
|
||||||
quota_reached: false,
|
output_set_up: false,
|
||||||
});
|
metrics_set_up: true,
|
||||||
|
quota_reached: false,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -340,15 +360,19 @@ describe('EvaluationsRootView', () => {
|
|||||||
renderComponent({ props: { name: mockWorkflow.id } });
|
renderComponent({ props: { name: mockWorkflow.id } });
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(useTelemetry().track).toHaveBeenCalledWith('User viewed tests tab', {
|
expect(useTelemetry().track).toHaveBeenCalledWith(
|
||||||
workflow_id: mockWorkflow.id,
|
'User viewed tests tab',
|
||||||
test_type: 'evaluation',
|
{
|
||||||
view: 'setup',
|
workflow_id: mockWorkflow.id,
|
||||||
trigger_set_up: false,
|
test_type: 'evaluation',
|
||||||
output_set_up: false,
|
view: 'setup',
|
||||||
metrics_set_up: false,
|
trigger_set_up: false,
|
||||||
quota_reached: true,
|
output_set_up: false,
|
||||||
});
|
metrics_set_up: false,
|
||||||
|
quota_reached: true,
|
||||||
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user