mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(n8n Evaluation Trigger Node): Fix tweaks (#15473)
This commit is contained in:
@@ -139,6 +139,32 @@ function getAiNodesBySubcategory(nodes: INodeTypeDescription[], subcategory: str
|
||||
.sort((a, b) => a.properties.displayName.localeCompare(b.properties.displayName));
|
||||
}
|
||||
|
||||
function getEvaluationNode(
|
||||
nodeTypesStore: ReturnType<typeof useNodeTypesStore>,
|
||||
isEvaluationVariantEnabled: boolean,
|
||||
) {
|
||||
const evaluationNodeStore = nodeTypesStore.getNodeType('n8n-nodes-base.evaluation');
|
||||
|
||||
if (!isEvaluationVariantEnabled || !evaluationNodeStore) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const evaluationNode = getNodeView(evaluationNodeStore);
|
||||
|
||||
return [
|
||||
{
|
||||
...evaluationNode,
|
||||
properties: {
|
||||
...evaluationNode.properties,
|
||||
defaults: {
|
||||
name: 'Evaluation',
|
||||
color: '#c3c9d5',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
||||
const i18n = useI18n();
|
||||
const nodeTypesStore = useNodeTypesStore();
|
||||
@@ -150,9 +176,7 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
||||
EVALUATION_TRIGGER.variant,
|
||||
);
|
||||
|
||||
const evaluationNodeStore = nodeTypesStore.getNodeType('n8n-nodes-base.evaluation');
|
||||
const evaluationNode =
|
||||
isEvaluationVariantEnabled && evaluationNodeStore ? [getNodeView(evaluationNodeStore)] : [];
|
||||
const evaluationNode = getEvaluationNode(nodeTypesStore, isEvaluationVariantEnabled);
|
||||
|
||||
const chainNodes = getAiNodesBySubcategory(nodeTypesStore.allLatestNodeTypes, AI_CATEGORY_CHAINS);
|
||||
const agentNodes = getAiNodesBySubcategory(nodeTypesStore.allLatestNodeTypes, AI_CATEGORY_AGENTS);
|
||||
@@ -358,9 +382,13 @@ export function TriggerView() {
|
||||
properties: {
|
||||
group: [],
|
||||
name: EVALUATION_TRIGGER_NODE_TYPE,
|
||||
displayName: 'Evaluation Trigger',
|
||||
displayName: 'When running evaluation',
|
||||
description: 'Run a dataset through your workflow to test performance',
|
||||
icon: 'fa:check-double',
|
||||
defaults: {
|
||||
name: 'Evaluation',
|
||||
color: '#c3c9d5',
|
||||
},
|
||||
},
|
||||
}
|
||||
: null;
|
||||
|
||||
Reference in New Issue
Block a user