🐛 fix(parameterComponent): add missing prop 'editNode' to KeypairListComponent to fix component rendering issue
🐛 fix(EditNodeModal): import KeypairListComponent to fix missing import error ✨ feat(EditNodeModal): add support for editing keypair type template parameters by adding KeypairListComponent and handling new values
This commit is contained in:
parent
151d01f506
commit
9424d5738a
2 changed files with 24 additions and 0 deletions
|
|
@ -363,6 +363,7 @@ export default function ParameterComponent({
|
||||||
<div className="mt-2 w-full">
|
<div className="mt-2 w-full">
|
||||||
<KeypairListComponent
|
<KeypairListComponent
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
editNode={false}
|
||||||
value={
|
value={
|
||||||
arrayOfObjects
|
arrayOfObjects
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import InputComponent from "../../components/inputComponent";
|
||||||
import InputFileComponent from "../../components/inputFileComponent";
|
import InputFileComponent from "../../components/inputFileComponent";
|
||||||
import InputListComponent from "../../components/inputListComponent";
|
import InputListComponent from "../../components/inputListComponent";
|
||||||
import IntComponent from "../../components/intComponent";
|
import IntComponent from "../../components/intComponent";
|
||||||
|
import KeypairListComponent from "../../components/keypairListComponent";
|
||||||
import PromptAreaComponent from "../../components/promptComponent";
|
import PromptAreaComponent from "../../components/promptComponent";
|
||||||
import TextAreaComponent from "../../components/textAreaComponent";
|
import TextAreaComponent from "../../components/textAreaComponent";
|
||||||
import ToggleShadComponent from "../../components/toggleShadComponent";
|
import ToggleShadComponent from "../../components/toggleShadComponent";
|
||||||
|
|
@ -78,6 +79,18 @@ const EditNodeModal = forwardRef(
|
||||||
setMyData(data); // reset data to what it is on node when opening modal
|
setMyData(data); // reset data to what it is on node when opening modal
|
||||||
}, [modalOpen]);
|
}, [modalOpen]);
|
||||||
|
|
||||||
|
const [arrayOfObjects, setArrayOfObjects] = useState([
|
||||||
|
{ key1: "value1", key2: "value2" },
|
||||||
|
{ key3: "value3", key4: "value4" },
|
||||||
|
{ key5: "value5", key6: "value6" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const handleOnNewValueTest = (newValue): void => {
|
||||||
|
let newData = cloneDeep(arrayOfObjects);
|
||||||
|
newData = newValue;
|
||||||
|
setArrayOfObjects(newData);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseModal size="large-h-full" open={modalOpen} setOpen={setModalOpen}>
|
<BaseModal size="large-h-full" open={modalOpen} setOpen={setModalOpen}>
|
||||||
<BaseModal.Trigger>{children}</BaseModal.Trigger>
|
<BaseModal.Trigger>{children}</BaseModal.Trigger>
|
||||||
|
|
@ -336,6 +349,16 @@ const EditNodeModal = forwardRef(
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
) : myData.node?.template[templateParam].type ===
|
||||||
|
"keypair" ? (
|
||||||
|
<div className="mt-2 w-full">
|
||||||
|
<KeypairListComponent
|
||||||
|
disabled={disabled}
|
||||||
|
value={arrayOfObjects}
|
||||||
|
onChange={handleOnNewValueTest}
|
||||||
|
editNode={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
) : myData.node?.template[templateParam].type ===
|
) : myData.node?.template[templateParam].type ===
|
||||||
"Any" ? (
|
"Any" ? (
|
||||||
"-"
|
"-"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue