fix(striker-ui): unset message and validity where necessary in manage manifest

main
Tsu-ba-me 2 years ago
parent bc25f1a2ad
commit 4bbd8a32f3
  1. 3
      striker-ui/components/ManageManifest/AnHostInputGroup.tsx
  2. 10
      striker-ui/components/ManageManifest/AnNetworkConfigInputGroup.tsx
  3. 4
      striker-ui/components/ManageManifest/AnNetworkInputGroup.tsx

@ -109,6 +109,7 @@ const AnHostInputGroup = <M extends MapToInputTestID>({
formUtils: {
buildFinishInputTestBatchFunction,
buildInputFirstRenderFunction,
buildInputUnmountFunction,
setMessage,
},
hostId,
@ -233,6 +234,7 @@ const AnHostInputGroup = <M extends MapToInputTestID>({
},
)}
onFirstRender={buildInputFirstRenderFunction(inputId)}
onUnmount={buildInputUnmountFunction(inputId)}
required
/>
),
@ -247,6 +249,7 @@ const AnHostInputGroup = <M extends MapToInputTestID>({
hostId,
buildFinishInputTestBatchFunction,
buildInputFirstRenderFunction,
buildInputUnmountFunction,
setMessage,
],
);

@ -51,7 +51,7 @@ const AnNetworkConfigInputGroup = <
buildFinishInputTestBatchFunction,
buildInputFirstRenderFunction,
setMessage,
unsetKeyRe,
setMessageRe,
} = formUtils;
const getNetworkNumber = useCallback(
@ -140,8 +140,8 @@ const AnNetworkConfigInputGroup = <
if (networkId === targetId) {
isIdMatch = true;
networkType = newType;
setMessageRe(RegExp(networkId));
}
const isTypeMatch = networkType === newType;
@ -173,7 +173,7 @@ const AnNetworkConfigInputGroup = <
setNetworkList(newList);
},
[networkListEntries, setNetworkList],
[networkListEntries, setMessageRe, setNetworkList],
);
const handleNetworkRemove = useCallback<AnNetworkCloseEventHandler>(
@ -185,8 +185,6 @@ const AnNetworkConfigInputGroup = <
(previous, [networkId, networkValue]) => {
if (networkId === rmId) {
isIdMatch = true;
unsetKeyRe(RegExp(rmId));
} else {
const { networkType } = networkValue;
@ -206,7 +204,7 @@ const AnNetworkConfigInputGroup = <
setNetworkList(newList);
},
[networkListEntries, setNetworkList, unsetKeyRe],
[networkListEntries, setNetworkList],
);
const networksGridLayout = useMemo<GridLayout>(() => {

@ -80,6 +80,7 @@ const AnNetworkInputGroup = <M extends MapToInputTestID>({
formUtils: {
buildFinishInputTestBatchFunction,
buildInputFirstRenderFunction,
buildInputUnmountFunction,
setMessage,
},
inputGatewayLabel = 'Gateway',
@ -195,6 +196,7 @@ const AnNetworkInputGroup = <M extends MapToInputTestID>({
},
)}
onFirstRender={buildInputFirstRenderFunction(inputIdGateway)}
onUnmount={buildInputUnmountFunction(inputIdGateway)}
required={isShowGateway}
/>
);
@ -210,6 +212,7 @@ const AnNetworkInputGroup = <M extends MapToInputTestID>({
networkName,
buildFinishInputTestBatchFunction,
buildInputFirstRenderFunction,
buildInputUnmountFunction,
setMessage,
]);
@ -278,6 +281,7 @@ const AnNetworkInputGroup = <M extends MapToInputTestID>({
},
)}
onFirstRender={buildInputFirstRenderFunction(inputIdMinIp)}
onUnmount={buildInputUnmountFunction(inputIdMinIp)}
required
/>
),

Loading…
Cancel
Save