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 { isFormInvalid: isRunFormInvalid } = runFormUtils;
const { const { hostConfig: { hosts: mdetailHosts = {} } = {}, name: mdetailName } =
domain: mdetailDomain, useMemo<Partial<APIManifestDetail>>(
hostConfig: { hosts: mdetailHosts = {} } = {},
name: mdetailName,
prefix: mdetailPrefix,
sequence: mdetailSequence,
} = useMemo<Partial<APIManifestDetail>>(
() => manifestDetail ?? {}, () => manifestDetail ?? {},
[manifestDetail], [manifestDetail],
); );
const { fences: knownFences, upses: knownUpses } = useMemo< const {
Partial<APIManifestTemplate> domain: mtemplateDomain,
>(() => manifestTemplate ?? {}, [manifestTemplate]); fences: knownFences,
prefix: mtemplatePrefix,
sequence: mtemplateSequence,
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