mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user