Skip to content

Commit

Permalink
refactor remaining modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Oct 24, 2024
1 parent 40a2ec6 commit 0f0628c
Showing 1 changed file with 28 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Modal } from '@patternfly/react-core/deprecated';
import DashboardModalFooter from '~/app/components/DashboardModalFooter';
import { Alert, Form, ModalHeader, Modal, ModalBody } from '@patternfly/react-core';

// import useNotification from '~/utilities/useNotification'; TODO: Implement useNotification

Expand Down Expand Up @@ -41,27 +41,40 @@ export const RestoreRegisteredModelModal: React.FC<RestoreRegisteredModelModalPr
}
}, [onSubmit, onClose]);

const description = (
<>
<b>{registeredModelName}</b> and all of its versions will be restored and returned to the
registered models list.
</>
);

return (
<Modal
isOpen={isOpen}
title="Restore model?"
variant="small"
onClose={onClose}
footer={
<DashboardModalFooter
onCancel={onClose}
onSubmit={onConfirm}
submitLabel="Restore"
isSubmitLoading={isSubmitting}
error={error}
alertTitle="Error"
isSubmitDisabled={isSubmitting}
/>
}
data-testid="restore-registered-model-modal"
>
<b>{registeredModelName}</b> and all of its versions will be restored and returned to the
registered models list.
<ModalHeader title="Restore model?" />
<ModalBody>
<Form>
{error && (
<Alert data-testid="error-message-alert" isInline variant="danger" title={'Error'}>
{error.message}
</Alert>
)}
</Form>
{description}
</ModalBody>
<DashboardModalFooter
onCancel={onClose}
onSubmit={onConfirm}
submitLabel="Restore"
isSubmitLoading={isSubmitting}
error={error}
alertTitle="Error"
isSubmitDisabled={isSubmitting}
/>
</Modal>
);
};

0 comments on commit 0f0628c

Please sign in to comment.