diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 7f5f5dc84..f0264ee2d 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -103,8 +103,6 @@ export default function ParameterComponent({ const [obj, setObj] = useState({ arr: ["test", 123456, false, null], boolean: false, - longString: - "long string long string long string long string long string long string", number: 123456, try: { k1: 123, @@ -239,34 +237,6 @@ export default function ParameterComponent({ type === "int") && !optionalHandle ? ( <> - ) : left === true && type === "NestedDict" ? ( -
- { - setObj(newValue); - }} - /> -
- ) : left === true && type === "dict" ? ( -
- { - setErrorDuplicateKey(hasDuplicateKeys(newValue)); - if (hasDuplicateKeys(newValue)) { - setDictArr(newValue); - } else { - setDict(convertArrayToObj(newValue)); - } - }} - /> -
) : ( + ) : left === true && type === "NestedDict" ? ( +
+ { + setObj(newValue); + data.node!.template[name].value = newValue; + console.log(data); + }} + /> +
+ ) : left === true && type === "dict" ? ( +
+ { + setErrorDuplicateKey(hasDuplicateKeys(newValue)); + if (hasDuplicateKeys(newValue)) { + setDictArr(newValue); + } else { + setDict(convertArrayToObj(newValue)); + data.node!.template[name].value = convertArrayToObj(newValue); + } + }} + /> +
) : ( <> )} diff --git a/src/frontend/src/components/keypairListComponent/index.tsx b/src/frontend/src/components/keypairListComponent/index.tsx index ef3f58e39..b88b17946 100644 --- a/src/frontend/src/components/keypairListComponent/index.tsx +++ b/src/frontend/src/components/keypairListComponent/index.tsx @@ -2,8 +2,6 @@ import { useEffect } from "react"; import { KeyPairListComponentType } from "../../types/components"; import _ from "lodash"; -import { TypeModal } from "../../constants/enums"; -import GenericModal from "../../modals/genericModal"; import { classNames } from "../../utils/utils"; import IconComponent from "../genericIconComponent"; import { Input } from "../ui/input"; @@ -13,7 +11,7 @@ export default function KeypairListComponent({ onChange, disabled, editNode = false, - duplicateKey + duplicateKey, }: KeyPairListComponentType): JSX.Element { useEffect(() => { if (disabled) { @@ -56,9 +54,8 @@ export default function KeypairListComponent({ // /> // // ) - - const handleChangeKey = (event, idx) => { + const handleChangeKey = (event, idx) => { const newInputList = _.cloneDeep(value); const oldKey = Object.keys(newInputList[idx])[0]; const updatedObj = { [event.target.value]: newInputList[idx][oldKey] }; @@ -89,10 +86,8 @@ export default function KeypairListComponent({ type="text" value={key} className={classNames( - editNode - ? "input-edit-node" - : "", - duplicateKey ? "input-invalid" : "" + editNode ? "input-edit-node" : "", + duplicateKey ? "input-invalid" : "" )} placeholder="Type key..." onChange={(event) => handleChangeKey(event, index)} @@ -103,23 +98,17 @@ export default function KeypairListComponent({ } }} /> - { - handleChangeValue(value, index); - }} - > - - + className={editNode ? "input-edit-node" : ""} + placeholder="Click to input a value..." + onChange={(event) => + handleChangeValue(event.target.value, index) + } + /> {index === value.length - 1 ? (