diff --git a/backend/config/default.cjs b/backend/config/default.cjs index aab5979cb..bbae1d2ac 100644 --- a/backend/config/default.cjs +++ b/backend/config/default.cjs @@ -191,7 +191,7 @@ module.exports = { enabled: false, }, export: { - enabled: false, + enabled: true, disclaimer: '## Example Agreement \n I agree that this model is suitable for exporting', }, }, diff --git a/backend/src/services/mirroredModel.ts b/backend/src/services/mirroredModel.ts index edf1f801c..f3fe485a1 100644 --- a/backend/src/services/mirroredModel.ts +++ b/backend/src/services/mirroredModel.ts @@ -46,6 +46,9 @@ export async function exportModel( if (!model.settings.mirror.destinationModelId) { throw BadReq(`The 'Destination Model ID' has not been set on this model.`) } + if (!model.card || !model.card.schemaId) { + throw BadReq('You must select a schema for your model before you can start the export process.') + } const mirroredModelId = model.settings.mirror.destinationModelId const auth = await authorisation.model(user, model, ModelAction.Update) if (!auth.success) { diff --git a/frontend/src/entry/model/mirroredModels/ExportModelAgreement.tsx b/frontend/src/entry/model/mirroredModels/ExportModelAgreement.tsx index 70078cb87..989245704 100644 --- a/frontend/src/entry/model/mirroredModels/ExportModelAgreement.tsx +++ b/frontend/src/entry/model/mirroredModels/ExportModelAgreement.tsx @@ -1,5 +1,5 @@ import { LoadingButton } from '@mui/lab' -import { Box, Button, Card, Checkbox, Container, FormControlLabel, Stack, Typography } from '@mui/material' +import { Box, Button, Checkbox, FormControlLabel, Stack, Typography } from '@mui/material' import { postModelExportToS3 } from 'actions/model' import { ChangeEvent, FormEvent, useState } from 'react' import Restricted from 'src/common/Restricted' @@ -46,27 +46,25 @@ export default function ExportModelAgreement({ modelId }: ExportModelAgreementPr } return ( - - - - Model Export Agreement - - - - - } - label='I agree to the terms and conditions of this model export agreement' - /> - Submit}> - - Submit - - - - - - - + <> + + Model Export Agreement + + + + + } + label='I agree to the terms and conditions of this model export agreement' + /> + Submit}> + + Submit + + + + + + ) } diff --git a/frontend/src/entry/model/mirroredModels/ExportSettings.tsx b/frontend/src/entry/model/mirroredModels/ExportSettings.tsx index 62f2839fc..a069d7d8c 100644 --- a/frontend/src/entry/model/mirroredModels/ExportSettings.tsx +++ b/frontend/src/entry/model/mirroredModels/ExportSettings.tsx @@ -1,6 +1,5 @@ -import ExpandMoreIcon from '@mui/icons-material/ExpandMore' import { LoadingButton } from '@mui/lab' -import { Accordion, AccordionDetails, AccordionSummary, Box, Stack, TextField, Typography } from '@mui/material' +import { Box, Card, Container, Divider, Stack, TextField, Typography } from '@mui/material' import { patchModel } from 'actions/model' import { ChangeEvent, FormEvent, useState } from 'react' import LabelledInput from 'src/common/LabelledInput' @@ -55,25 +54,23 @@ export default function ExportSettings({ model }: ExportSettingsProps) { return ( <> - - - }> - - Export Settings - - - + + - - - - - {/*TODO - Add the ability to filter releases needed for export (This functionality is not available on the backend) + }> + <> + + Model Export Settings + + + + + {/*TODO - Add the ability to filter releases needed for export (This functionality is not available on the backend) */} - - Save - - + + Save + + + + - - + + ) }