fix(editor): Hide evaluation trigger (#15471)

This commit is contained in:
Dana
2025-05-16 16:56:19 +02:00
committed by GitHub
parent 235cabc0bf
commit b53bd173d0
2 changed files with 22 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ describe('NodesListPanel', () => {
await fireEvent.click(container.querySelector('.backButton')!);
await nextTick();
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(9);
expect(screen.queryAllByTestId('item-iterator-item')).toHaveLength(8);
});
it('should render regular nodes', async () => {

View File

@@ -344,6 +344,26 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView {
export function TriggerView() {
const i18n = useI18n();
const posthogStore = usePostHog();
const isEvaluationVariantEnabled = posthogStore.isVariantEnabled(
EVALUATION_TRIGGER.name,
EVALUATION_TRIGGER.variant,
);
const evaluationTriggerNode = isEvaluationVariantEnabled
? {
key: EVALUATION_TRIGGER_NODE_TYPE,
type: 'node',
category: [CORE_NODES_CATEGORY],
properties: {
group: [],
name: EVALUATION_TRIGGER_NODE_TYPE,
displayName: 'Evaluation Trigger',
description: 'Run a dataset through your workflow to test performance',
icon: 'fa:check-double',
},
}
: null;
const view: NodeView = {
value: TRIGGER_NODE_CREATOR_VIEW,
@@ -437,18 +457,7 @@ export function TriggerView() {
icon: 'fa:comments',
},
},
{
key: EVALUATION_TRIGGER_NODE_TYPE,
type: 'node',
category: [CORE_NODES_CATEGORY],
properties: {
group: [],
name: EVALUATION_TRIGGER_NODE_TYPE,
displayName: 'Evaluation Trigger',
description: 'Run a dataset through your workflow to test performance',
icon: 'fa:check-double',
},
},
...(evaluationTriggerNode ? [evaluationTriggerNode] : []),
{
type: 'subcategory',
key: OTHER_TRIGGER_NODES_SUBCATEGORY,