feat(editor): Evaluations frontend (no-changelog) (#15550)

Co-authored-by: Yiorgis Gozadinos <yiorgis@n8n.io>
Co-authored-by: JP van Oosten <jp@n8n.io>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Eugene
2025-05-26 12:26:28 +02:00
committed by GitHub
parent 3ee15a8331
commit ca8f087a47
87 changed files with 3460 additions and 5103 deletions

View File

@@ -70,7 +70,12 @@ import {
import { useSourceControlStore } from '@/stores/sourceControl.store';
import { useNodeCreatorStore } from '@/stores/nodeCreator.store';
import { useExternalHooks } from '@/composables/useExternalHooks';
import { NodeConnectionTypes, jsonParse } from 'n8n-workflow';
import {
NodeConnectionTypes,
jsonParse,
EVALUATION_TRIGGER_NODE_TYPE,
EVALUATION_NODE_TYPE,
} from 'n8n-workflow';
import type { NodeConnectionType, IDataObject, ExecutionSummary, IConnection } from 'n8n-workflow';
import { useToast } from '@/composables/useToast';
import { useSettingsStore } from '@/stores/settings.store';
@@ -327,6 +332,22 @@ async function initializeRoute(force = false) {
return;
}
// Open node panel if the route has a corresponding action
if (route.query.action === 'addEvaluationTrigger') {
nodeCreatorStore.openNodeCreatorForTriggerNodes(
NODE_CREATOR_OPEN_SOURCES.ADD_EVALUATION_TRIGGER_BUTTON,
);
} else if (route.query.action === 'addEvaluationNode') {
nodeCreatorStore.openNodeCreatorForActions(
EVALUATION_NODE_TYPE,
NODE_CREATOR_OPEN_SOURCES.ADD_EVALUATION_NODE_BUTTON,
);
} else if (route.query.action === 'executeEvaluation') {
if (evaluationTriggerNode.value) {
void runEntireWorkflow('node', evaluationTriggerNode.value.name);
}
}
const isAlreadyInitialized =
!force &&
initializedWorkflowId.value &&
@@ -1361,6 +1382,13 @@ function onOpenChat() {
startChat('main');
}
/**
* Evaluation
*/
const evaluationTriggerNode = computed(() => {
return editableWorkflow.value.nodes.find((node) => node.type === EVALUATION_TRIGGER_NODE_TYPE);
});
/**
* History events
*/