diff --git a/Makefile b/Makefile
index c0c6a7abc..0b05ec7cf 100644
--- a/Makefile
+++ b/Makefile
@@ -32,10 +32,10 @@ lint:
poetry run ruff . --fix
install_frontend:
- cd src/frontend && npm install;
+ cd src/frontend && npm install
install_frontendc:
- cd src/frontend && rm -rf node_modules package-lock.json && npm install;
+ cd src/frontend && rm -rf node_modules package-lock.json && npm install
run_frontend:
cd src/frontend && npm start
diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx
index 94cc939ff..0b577ed65 100644
--- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx
+++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx
@@ -31,6 +31,7 @@ import {
nodeNames,
} from "../../../../utils/styleUtils";
import { classNames, groupByFamily } from "../../../../utils/utils";
+import KeypairListComponent from "../../../../components/keypairListComponent";
export default function ParameterComponent({
left,
@@ -93,6 +94,22 @@ export default function ParameterComponent({
renderTooltips();
};
+ 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);
+ };
+
+
+
+
useEffect(() => {
if (name === "openai_api_base") console.log(info);
// @ts-ignore
@@ -341,7 +358,19 @@ export default function ParameterComponent({
onChange={handleOnNewValue}
/>
- ) : (
+ )
+ : left === true && type === "keypair" ? (
+
+
+
+ )
+ : (
<>>
)}
>
diff --git a/src/frontend/src/components/keypairListComponent/index.tsx b/src/frontend/src/components/keypairListComponent/index.tsx
new file mode 100644
index 000000000..efb122414
--- /dev/null
+++ b/src/frontend/src/components/keypairListComponent/index.tsx
@@ -0,0 +1,108 @@
+import { useEffect } from "react";
+import { KeyPairListComponent } from "../../types/components";
+
+import _ from "lodash";
+import { classNames } from "../../utils/utils";
+import IconComponent from "../genericIconComponent";
+import { Input } from "../ui/input";
+
+export default function KeypairListComponent({
+ value,
+ onChange,
+ disabled,
+ editNode = false,
+}: KeyPairListComponent): JSX.Element {
+ useEffect(() => {
+ if (disabled) {
+ onChange([""]);
+ }
+ }, [disabled]);
+
+ const handleChangeKey = (event, idx) => {
+ const newInputList = _.cloneDeep(value);
+ const oldKey = Object.keys(newInputList[idx])[0];
+ const updatedObj = { [event.target.value]: newInputList[idx][oldKey] };
+ newInputList[idx] = updatedObj;
+ onChange(newInputList);
+ };
+
+ const handleChangeValue = (event, idx) => {
+ const newInputList = _.cloneDeep(value);
+ const key = Object.keys(newInputList[idx])[0];
+ newInputList[idx][key] = event.target.value;
+ onChange(newInputList);
+ };
+
+ return (
+
+ );
+}
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts
index c3e515333..62702a9e9 100644
--- a/src/frontend/src/types/components/index.ts
+++ b/src/frontend/src/types/components/index.ts
@@ -54,6 +54,13 @@ export type InputListComponentType = {
editNode?: boolean;
};
+export type KeyPairListComponent = {
+ value: any[];
+ onChange: (value: string[]) => void;
+ disabled: boolean;
+ editNode?: boolean;
+};
+
export type TextAreaComponentType = {
field_name?: string;
nodeClass?: APIClassType;