🐛 fix(parameterComponent): fix incorrect type check for dict and keypair components in ParameterComponent
🐛 fix(dictComponent): fix import statement for DictComponentType in dictComponent 🐛 fix(keypairListComponent): fix import statement for KeyPairListComponentType in keypairListComponent 🐛 fix(EditNodeModal): fix incorrect type check for dict and keypair components in EditNodeModal 🐛 fix(types): rename KeyPairListComponent to KeyPairListComponentType and add DictComponentType
This commit is contained in:
parent
1beca4ed12
commit
54e3fd15dc
5 changed files with 16 additions and 9 deletions
|
|
@ -241,7 +241,7 @@ export default function ParameterComponent({
|
|||
!optionalHandle ? (
|
||||
<></>
|
||||
)
|
||||
: left === true && type === "str" ? (
|
||||
: left === true && type === "dict" ? (
|
||||
<div className="mt-2 w-full">
|
||||
<DictComponent
|
||||
disabled={disabled}
|
||||
|
|
@ -253,7 +253,7 @@ export default function ParameterComponent({
|
|||
/>
|
||||
</div>
|
||||
)
|
||||
: left === true && type === "dict" ? (
|
||||
: left === true && type === "keypair" ? (
|
||||
<div className="mt-2 w-full">
|
||||
<KeypairListComponent
|
||||
disabled={disabled}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect } from "react";
|
||||
import { KeyPairListComponent } from "../../types/components";
|
||||
import { DictComponentType } from "../../types/components";
|
||||
|
||||
import { classNames } from "../../utils/utils";
|
||||
import { Input } from "../ui/input";
|
||||
|
|
@ -10,7 +10,7 @@ export default function DictComponent({
|
|||
onChange,
|
||||
disabled,
|
||||
editNode = false,
|
||||
}: KeyPairListComponent): JSX.Element {
|
||||
}: DictComponentType): JSX.Element {
|
||||
useEffect(() => {
|
||||
if (disabled) {
|
||||
onChange([""]);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect } from "react";
|
||||
import { KeyPairListComponent } from "../../types/components";
|
||||
import { KeyPairListComponentType } from "../../types/components";
|
||||
|
||||
import _ from "lodash";
|
||||
import { TypeModal } from "../../constants/enums";
|
||||
|
|
@ -14,7 +14,7 @@ export default function KeypairListComponent({
|
|||
disabled,
|
||||
editNode = false,
|
||||
duplicateKey
|
||||
}: KeyPairListComponent): JSX.Element {
|
||||
}: KeyPairListComponentType): JSX.Element {
|
||||
useEffect(() => {
|
||||
if (disabled) {
|
||||
onChange([""]);
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ const EditNodeModal = forwardRef(
|
|||
/>
|
||||
)
|
||||
: myData.node?.template[templateParam]
|
||||
.type === "str" ? (
|
||||
.type === "dict" ? (
|
||||
<div className="mt-2 w-full">
|
||||
<DictComponent
|
||||
disabled={disabled}
|
||||
|
|
@ -219,7 +219,7 @@ const EditNodeModal = forwardRef(
|
|||
</div>
|
||||
)
|
||||
: myData.node?.template[templateParam]
|
||||
.type === "dict" ? (
|
||||
.type === "keypair" ? (
|
||||
<div className="mt-2 w-full">
|
||||
<KeypairListComponent
|
||||
disabled={disabled}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export type InputListComponentType = {
|
|||
editNode?: boolean;
|
||||
};
|
||||
|
||||
export type KeyPairListComponent = {
|
||||
export type KeyPairListComponentType = {
|
||||
value: any;
|
||||
onChange: (value: string[]) => void;
|
||||
disabled: boolean;
|
||||
|
|
@ -62,6 +62,13 @@ export type KeyPairListComponent = {
|
|||
duplicateKey?: boolean;
|
||||
};
|
||||
|
||||
export type DictComponentType = {
|
||||
value: any;
|
||||
onChange: (value: string[]) => void;
|
||||
disabled: boolean;
|
||||
editNode?: boolean;
|
||||
};
|
||||
|
||||
export type TextAreaComponentType = {
|
||||
field_name?: string;
|
||||
nodeClass?: APIClassType;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue