From 4fc636cb9b2b03a4d41de434234bbc0c8f7393d3 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Mon, 24 Jul 2023 13:20:29 -0300 Subject: [PATCH] refactor[EditNodeModal]: Remove any types --- src/frontend/src/modals/EditNodeModal/index.tsx | 6 +++--- src/frontend/src/types/components/index.ts | 12 ++++++------ src/frontend/tsconfig.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index 05885a242..075bc22c9 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -78,7 +78,7 @@ export default function EditNodeModal({ } } - function changeAdvanced(node) { + function changeAdvanced(node: editNodeToggleType): void { Object.keys(data.node.template).map((n, i) => { if (n === node.name) { data.node.template[n].advanced = !data.node.template[n].advanced; @@ -88,8 +88,7 @@ export default function EditNodeModal({ setNodeValue(!nodeValue); } - const handleOnNewValue = (newValue, name) => { - console.log({ newValue, name }) + const handleOnNewValue = (newValue: string | string[] | boolean, name: string): void => { data.node.template[name].value = newValue; // Set state to pending setTabsState((prev) => { @@ -183,6 +182,7 @@ export default function EditNodeModal({ : data.node.template[n].value } onChange={(t: string[]) => { + console.log(t) handleOnNewValue(t, n); }} /> diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 0472e0a0f..bdaf78982 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -466,13 +466,13 @@ export type chatInputType = { }; export type editNodeToggleType = { - advanced: boolean; - info: string; + advanced?: boolean; + info?: string; list: boolean; - multiline: boolean; - name: string; - password: boolean; - placeholder: string; + multiline?: boolean; + name?: string; + password?: boolean; + placeholder?: string; required: boolean; show: boolean; type: string; diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json index c411ff4e7..88e7e83a6 100644 --- a/src/frontend/tsconfig.json +++ b/src/frontend/tsconfig.json @@ -15,7 +15,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "noImplicitAny": false + "noImplicitAny": true }, "include": ["src"] }