fix(striker-ui): populate add manifest form with template props

main
Tsu-ba-me 2 years ago
parent 79bcc3773b
commit 1e2aee47a3
  1. 34
      striker-ui/components/ManageManifest/ManageManifestPanel.tsx

@ -196,19 +196,21 @@ const ManageManifestPanel: FC = () => {
);
const { isFormInvalid: isRunFormInvalid } = runFormUtils;
const {
domain: mdetailDomain,
hostConfig: { hosts: mdetailHosts = {} } = {},
name: mdetailName,
prefix: mdetailPrefix,
sequence: mdetailSequence,
} = useMemo<Partial<APIManifestDetail>>(
const { hostConfig: { hosts: mdetailHosts = {} } = {}, name: mdetailName } =
useMemo<Partial<APIManifestDetail>>(
() => manifestDetail ?? {},
[manifestDetail],
);
const { fences: knownFences, upses: knownUpses } = useMemo<
Partial<APIManifestTemplate>
>(() => manifestTemplate ?? {}, [manifestTemplate]);
const {
domain: mtemplateDomain,
fences: knownFences,
prefix: mtemplatePrefix,
sequence: mtemplateSequence,
upses: knownUpses,
} = useMemo<Partial<APIManifestTemplate>>(
() => manifestTemplate ?? {},
[manifestTemplate],
);
const addManifestFormDialogProps = useMemo<ConfirmDialogProps>(
() => ({
@ -219,9 +221,9 @@ const ManageManifestPanel: FC = () => {
knownFences={knownFences}
knownUpses={knownUpses}
previous={{
domain: mdetailDomain,
prefix: mdetailPrefix,
sequence: mdetailSequence,
domain: mtemplateDomain,
prefix: mtemplatePrefix,
sequence: mtemplateSequence,
}}
/>
),
@ -231,12 +233,12 @@ const ManageManifestPanel: FC = () => {
titleText: 'Add an install manifest',
}),
[
mdetailDomain,
formUtils,
knownFences,
knownUpses,
mdetailPrefix,
mdetailSequence,
mtemplateDomain,
mtemplatePrefix,
mtemplateSequence,
],
);

Loading…
Cancel
Save