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,7 +105,9 @@ watch(
|
|||||||
(ready) => {
|
(ready) => {
|
||||||
if (ready) {
|
if (ready) {
|
||||||
if (showWizard.value) {
|
if (showWizard.value) {
|
||||||
telemetry.track('User viewed tests tab', {
|
telemetry.track(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: props.name,
|
workflow_id: props.name,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'setup',
|
view: 'setup',
|
||||||
@@ -113,14 +115,20 @@ watch(
|
|||||||
output_set_up: evaluationStore.evaluationSetOutputsNodeExist,
|
output_set_up: evaluationStore.evaluationSetOutputsNodeExist,
|
||||||
metrics_set_up: evaluationStore.evaluationSetMetricsNodeExist,
|
metrics_set_up: evaluationStore.evaluationSetMetricsNodeExist,
|
||||||
quota_reached: evaluationsQuotaExceeded.value,
|
quota_reached: evaluationsQuotaExceeded.value,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
telemetry.track('User viewed tests tab', {
|
telemetry.track(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: props.name,
|
workflow_id: props.name,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'overview',
|
view: 'overview',
|
||||||
run_count: runs.value.length,
|
run_count: runs.value.length,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -143,7 +143,9 @@ 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(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: mockWorkflow.id,
|
workflow_id: mockWorkflow.id,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'setup',
|
view: 'setup',
|
||||||
@@ -151,7 +153,9 @@ describe('EvaluationsRootView', () => {
|
|||||||
output_set_up: false,
|
output_set_up: false,
|
||||||
metrics_set_up: false,
|
metrics_set_up: false,
|
||||||
quota_reached: 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(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: mockWorkflow.id,
|
workflow_id: mockWorkflow.id,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'overview',
|
view: 'overview',
|
||||||
run_count: 2,
|
run_count: 2,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -212,7 +220,9 @@ 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(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: mockWorkflow.id,
|
workflow_id: mockWorkflow.id,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'setup',
|
view: 'setup',
|
||||||
@@ -220,7 +230,9 @@ describe('EvaluationsRootView', () => {
|
|||||||
output_set_up: false,
|
output_set_up: false,
|
||||||
metrics_set_up: false,
|
metrics_set_up: false,
|
||||||
quota_reached: false,
|
quota_reached: false,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -262,7 +274,9 @@ 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(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: mockWorkflow.id,
|
workflow_id: mockWorkflow.id,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'setup',
|
view: 'setup',
|
||||||
@@ -270,7 +284,9 @@ describe('EvaluationsRootView', () => {
|
|||||||
output_set_up: true,
|
output_set_up: true,
|
||||||
metrics_set_up: false,
|
metrics_set_up: false,
|
||||||
quota_reached: false,
|
quota_reached: false,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -312,7 +328,9 @@ 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(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: mockWorkflow.id,
|
workflow_id: mockWorkflow.id,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'setup',
|
view: 'setup',
|
||||||
@@ -320,7 +338,9 @@ describe('EvaluationsRootView', () => {
|
|||||||
output_set_up: false,
|
output_set_up: false,
|
||||||
metrics_set_up: true,
|
metrics_set_up: true,
|
||||||
quota_reached: false,
|
quota_reached: false,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -340,7 +360,9 @@ 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(
|
||||||
|
'User viewed tests tab',
|
||||||
|
{
|
||||||
workflow_id: mockWorkflow.id,
|
workflow_id: mockWorkflow.id,
|
||||||
test_type: 'evaluation',
|
test_type: 'evaluation',
|
||||||
view: 'setup',
|
view: 'setup',
|
||||||
@@ -348,7 +370,9 @@ describe('EvaluationsRootView', () => {
|
|||||||
output_set_up: false,
|
output_set_up: false,
|
||||||
metrics_set_up: false,
|
metrics_set_up: false,
|
||||||
quota_reached: true,
|
quota_reached: true,
|
||||||
});
|
},
|
||||||
|
{ withPostHog: true },
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user