fix(striker-ui): add message area to manage manifest forms

main
Tsu-ba-me 2 years ago
parent 2e26e3ed40
commit 5897353d7b
  1. 16
      striker-ui/components/ManageManifest/ManageManifestPanel.tsx

@ -21,7 +21,7 @@ import FormDialog from '../FormDialog';
import handleAPIError from '../../lib/handleAPIError'; import handleAPIError from '../../lib/handleAPIError';
import IconButton from '../IconButton'; import IconButton from '../IconButton';
import List from '../List'; import List from '../List';
import { MessageGroupForwardedRefContent } from '../MessageGroup'; import MessageGroup, { MessageGroupForwardedRefContent } from '../MessageGroup';
import { Panel, PanelHeader } from '../Panels'; import { Panel, PanelHeader } from '../Panels';
import periodicFetch from '../../lib/fetchers/periodicFetch'; import periodicFetch from '../../lib/fetchers/periodicFetch';
import RunManifestInputGroup, { import RunManifestInputGroup, {
@ -258,6 +258,17 @@ const ManageManifestPanel: FC = () => {
], ],
); );
const messageArea = useMemo(
() => (
<MessageGroup
count={1}
defaultMessageType="warning"
ref={messageGroupRef}
/>
),
[],
);
if (isFirstRender) { if (isFirstRender) {
api api
.get<APIManifestTemplate>('/manifest/template') .get<APIManifestTemplate>('/manifest/template')
@ -295,18 +306,21 @@ const ManageManifestPanel: FC = () => {
<FormDialog <FormDialog
{...addManifestFormDialogProps} {...addManifestFormDialogProps}
disableProceed={isFormInvalid} disableProceed={isFormInvalid}
preActionArea={messageArea}
ref={addManifestFormDialogRef} ref={addManifestFormDialogRef}
scrollContent scrollContent
/> />
<FormDialog <FormDialog
{...editManifestFormDialogProps} {...editManifestFormDialogProps}
disableProceed={isFormInvalid} disableProceed={isFormInvalid}
preActionArea={messageArea}
ref={editManifestFormDialogRef} ref={editManifestFormDialogRef}
scrollContent scrollContent
/> />
<FormDialog <FormDialog
{...runManifestFormDialogProps} {...runManifestFormDialogProps}
disableProceed={isRunFormInvalid} disableProceed={isRunFormInvalid}
preActionArea={messageArea}
ref={runManifestFormDialogRef} ref={runManifestFormDialogRef}
scrollContent scrollContent
/> />

Loading…
Cancel
Save