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

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

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

Loading…
Cancel
Save