refactor[EditNodeModal]: Remove any types
This commit is contained in:
parent
6113aae86f
commit
4fc636cb9b
3 changed files with 10 additions and 10 deletions
|
|
@ -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);
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
"noImplicitAny": false
|
||||
"noImplicitAny": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue