fix(striker-ui): correct none representation in run manifest

main^2
Tsu-ba-me 7 months ago
parent 6dee346e48
commit bdb0c8ddb0
  1. 22
      striker-ui/components/ManageManifest/RunManifestInputGroup.tsx

@ -45,12 +45,7 @@ const RunManifestInputGroup = <M extends MapToInputTestID>({
const passwordRef = useRef<InputForwardedRefContent<'string'>>({}); const passwordRef = useRef<InputForwardedRefContent<'string'>>({});
const { hosts: initHostList = {} } = hostConfig; const { hosts: initHostList = {} } = hostConfig;
const { const { dnsCsv, mtu, networks: initNetworkList = {}, ntpCsv } = networkConfig;
dnsCsv,
mtu,
networks: initNetworkList = {},
ntpCsv = MANIFEST_PARAM_NONE,
} = networkConfig;
const hostListEntries = useMemo( const hostListEntries = useMemo(
() => Object.entries(initHostList), () => Object.entries(initHostList),
@ -195,12 +190,10 @@ const RunManifestInputGroup = <M extends MapToInputTestID>({
}; };
hostListEntries.forEach(([hostId, { networks = {} }]) => { hostListEntries.forEach(([hostId, { networks = {} }]) => {
const { const { [networkId]: { networkIp: ip = '' } = {} } = networks;
[networkId]: { networkIp: ip = MANIFEST_PARAM_NONE } = {},
} = networks;
hostNetworks[`${idPrefix}-${hostId}-ip`] = { hostNetworks[`${idPrefix}-${hostId}-ip`] = {
children: <MonoText>{ip}</MonoText>, children: <MonoText>{ip || MANIFEST_PARAM_NONE}</MonoText>,
}; };
}); });
@ -237,11 +230,10 @@ const RunManifestInputGroup = <M extends MapToInputTestID>({
}; };
hostListEntries.forEach(([hostId, { fences = {} }]) => { hostListEntries.forEach(([hostId, { fences = {} }]) => {
const { [fenceName]: { fencePort = MANIFEST_PARAM_NONE } = {} } = const { [fenceName]: { fencePort = '' } = {} } = fences;
fences;
previous[`${idPrefix}-${hostId}-port`] = { previous[`${idPrefix}-${hostId}-port`] = {
children: <MonoText>{fencePort}</MonoText>, children: <MonoText>{fencePort || MANIFEST_PARAM_NONE}</MonoText>,
}; };
}); });
@ -426,13 +418,13 @@ const RunManifestInputGroup = <M extends MapToInputTestID>({
children: <BodyText>DNS</BodyText>, children: <BodyText>DNS</BodyText>,
}, },
'run-manifest-dns-csv-cell': { 'run-manifest-dns-csv-cell': {
children: <EndMono>{dnsCsv}</EndMono>, children: <EndMono>{dnsCsv || MANIFEST_PARAM_NONE}</EndMono>,
}, },
'run-manifest-ntp-csv-cell-header': { 'run-manifest-ntp-csv-cell-header': {
children: <BodyText>NTP</BodyText>, children: <BodyText>NTP</BodyText>,
}, },
'run-manifest-ntp-csv-cell': { 'run-manifest-ntp-csv-cell': {
children: <EndMono>{ntpCsv}</EndMono>, children: <EndMono>{ntpCsv || MANIFEST_PARAM_NONE}</EndMono>,
}, },
'run-manifest-mtu-cell-header': { 'run-manifest-mtu-cell-header': {
children: <BodyText>MTU</BodyText>, children: <BodyText>MTU</BodyText>,

Loading…
Cancel
Save