diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index c5623d3fa..a2313e4c0 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -54,7 +54,6 @@ export default function ParameterComponent({ const updateNodeInternals = useUpdateNodeInternals(); const [position, setPosition] = useState(0); const { setTabsState, tabId, save, flows } = useContext(TabsContext); - const [errorDuplicateKey, setErrorDuplicateKey] = useState(false); const flow = flows.find((flow) => flow.id === tabId)?.data?.nodes ?? null; @@ -96,20 +95,6 @@ export default function ParameterComponent({ renderTooltips(); }; - const [dict, setDict] = useState({ - key1: "value1", - key2: "value2", - key3: "value3", - key4: "value4", - key5: "value5", - key6: "value6", - } as {}); - const [dictArr, setDictArr] = useState([] as string[]); - - useEffect(() => { - setDictArr(convertObjToArray(dict)); - }, [dict]); - const [obj, setObj] = useState({ arr: ["test", 123456, false, null], @@ -248,30 +233,12 @@ export default function ParameterComponent({ editNode={false} value={obj} onChange={(newValue) => { - setDict(newValue); + setObj(newValue); }} /> ) - : left === true && type === "keypair" ? ( -
- { - setErrorDuplicateKey(hasDuplicateKeys(newValue)); - if(hasDuplicateKeys(newValue)){ - setDictArr(newValue); - } - else{ - setDict(convertArrayToObj(newValue)); - } - }} - /> -
- ) : ( + : ( { + // setDictArr(convertObjToArray(dict)); + // }, [dict]); + + // left === true && type === "keypairlist" ? ( + //
+ // { + // setErrorDuplicateKey(hasDuplicateKeys(newValue)); + // if(hasDuplicateKeys(newValue)){ + // setDictArr(newValue); + // } + // else{ + // setDict(convertArrayToObj(newValue)); + // } + // }} + // /> + //
+ // ) const handleChangeKey = (event, idx) => { diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index 437cdf232..c47b2503a 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -219,7 +219,7 @@ const EditNodeModal = forwardRef( ) : myData.node?.template[templateParam] - .type === "keypair" ? ( + .type === "keypairlist" ? (
void; + onChange: (value) => void; disabled: boolean; editNode?: boolean; }; diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 1394203f1..7c58864b2 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -321,10 +321,10 @@ export function hasDuplicateKeys(array) { for (const obj of array) { for (const key in obj) { if (keys[key]) { - return true; // Duplicate key found + return true; } keys[key] = true; } } - return false; // No duplicate keys found + return false; } \ No newline at end of file