Add workflows settings in start node (#1270)

This commit is contained in:
Shuchang Zheng
2024-11-26 10:41:18 -08:00
committed by GitHub
parent 61f94af7f3
commit e0aadac962
13 changed files with 275 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
import { useNodes, useReactFlow } from "@xyflow/react";
import { AppNode } from "../editor/nodes";
import { AppNode, isWorkflowBlockNode } from "../editor/nodes";
import {
getUniqueLabelForExistingNode,
getUpdatedNodesAfterLabelUpdateForParameterKeys,
@@ -21,7 +21,9 @@ function useNodeLabelChangeHandler({ id, initialValue }: Props) {
useWorkflowParametersState();
function handleLabelChange(value: string) {
const existingLabels = nodes.map((n) => n.data.label);
const existingLabels = nodes
.filter(isWorkflowBlockNode)
.map((n) => n.data.label);
const labelWithoutWhitespace = value.replace(/\s+/g, "_");
const newLabel = getUniqueLabelForExistingNode(
labelWithoutWhitespace,