🐛 fix(EditNodeModal): setAdv state variable to null initially to avoid undefined value
🐛 fix(types): change advanced prop type in KeyPairListComponentType to allow null value
This commit is contained in:
parent
1f62c596a2
commit
9d9a1177f2
2 changed files with 16 additions and 18 deletions
|
|
@ -76,6 +76,7 @@ const EditNodeModal = forwardRef(
|
|||
function changeAdvanced(n) {
|
||||
myData.current.node!.template[n].advanced =
|
||||
!myData.current.node!.template[n].advanced;
|
||||
setAdv(!adv);
|
||||
}
|
||||
|
||||
const handleOnNewValue = (newValue: any, name) => {
|
||||
|
|
@ -88,6 +89,7 @@ const EditNodeModal = forwardRef(
|
|||
}, [modalOpen]);
|
||||
|
||||
const [errorDuplicateKey, setErrorDuplicateKey] = useState(false);
|
||||
const [adv, setAdv] = useState<boolean | null>(null);
|
||||
|
||||
return (
|
||||
<BaseModal
|
||||
|
|
@ -266,11 +268,7 @@ const EditNodeModal = forwardRef(
|
|||
)}
|
||||
>
|
||||
<KeypairListComponent
|
||||
advanced={
|
||||
myData.current.node?.template[
|
||||
templateParam
|
||||
].advanced
|
||||
}
|
||||
advanced={adv}
|
||||
disabled={disabled}
|
||||
editNode={true}
|
||||
value={
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export type KeyPairListComponentType = {
|
|||
disabled: boolean;
|
||||
editNode?: boolean;
|
||||
duplicateKey?: boolean;
|
||||
advanced?: boolean;
|
||||
advanced?: boolean | null;
|
||||
};
|
||||
|
||||
export type DictComponentType = {
|
||||
|
|
@ -135,18 +135,18 @@ export type TooltipComponentType = {
|
|||
children: ReactElement;
|
||||
title: string | ReactElement;
|
||||
placement?:
|
||||
| "bottom-end"
|
||||
| "bottom-start"
|
||||
| "bottom"
|
||||
| "left-end"
|
||||
| "left-start"
|
||||
| "left"
|
||||
| "right-end"
|
||||
| "right-start"
|
||||
| "right"
|
||||
| "top-end"
|
||||
| "top-start"
|
||||
| "top";
|
||||
| "bottom-end"
|
||||
| "bottom-start"
|
||||
| "bottom"
|
||||
| "left-end"
|
||||
| "left-start"
|
||||
| "left"
|
||||
| "right-end"
|
||||
| "right-start"
|
||||
| "right"
|
||||
| "top-end"
|
||||
| "top-start"
|
||||
| "top";
|
||||
};
|
||||
|
||||
export type ProgressBarType = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue