diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a9a061..ee328957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ Skeleton (), () - Fixed invocation of serverless functions () - Removing label attributes () +- Notification with a required manifest file () ### Security - TDB diff --git a/cvat-ui/package.json b/cvat-ui/package.json index b95a900d..74411692 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.41.4", + "version": "1.41.5", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx b/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx index 01f161a6..f8b62a7c 100644 --- a/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx +++ b/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx @@ -203,10 +203,8 @@ export default function CreateCloudStorageForm(props: Props): JSX.Element { } }, []); - const onSubmit = async (): Promise => { - let cloudStorageData: Record = {}; - const formValues = await form.validateFields(); - cloudStorageData = { ...formValues }; + const handleOnFinish = (formValues: CloudStorageForm): void => { + const cloudStorageData: Record = { ...formValues }; // specific attributes const specificAttributes = new URLSearchParams(); @@ -607,7 +605,12 @@ export default function CreateCloudStorageForm(props: Props): JSX.Element { }; return ( -
+ handleOnFinish(values)} + > { const newManifestFormItems = manifestNames.map((name, idx) => ({ @@ -70,7 +73,6 @@ export default function ManifestsManager(props: Props): JSX.Element { return ( <> @@ -80,18 +82,29 @@ export default function ManifestsManager(props: Props): JSX.Element { type='link' target='_blank' className='cvat-cloud-storage-help-button' - href='https://opencv.github.io/cvat/docs/manual/advanced/dataset_manifest/' + href={DATASET_MANIFEST_GUIDE_URL} > )} - rules={[{ required: true, message: 'Please, specify at least one manifest file' }]} + required /> - + => { + if (!names || !names.length) { + throw new Error('Please, specify at least one manifest file'); + } + }, + }, + ]} + > { - (fields) => ( + (fields: FormListFieldData[], _: FormListOperation, { errors }: { errors: React.ReactNode[] }) => ( <> {fields.map((field, idx): JSX.Element => ( @@ -123,6 +136,7 @@ export default function ManifestsManager(props: Props): JSX.Element { ))} + ) } diff --git a/cvat-ui/src/consts.ts b/cvat-ui/src/consts.ts index 0c0ed19e..be1535c5 100644 --- a/cvat-ui/src/consts.ts +++ b/cvat-ui/src/consts.ts @@ -16,6 +16,7 @@ const SHARE_MOUNT_GUIDE_URL = 'https://opencv.github.io/cvat/docs/administration/basics/installation/#share-path'; const NUCLIO_GUIDE = 'https://opencv.github.io/cvat//docs/administration/advanced/installation_automatic_annotation/'; +const DATASET_MANIFEST_GUIDE_URL = 'https://opencv.github.io/cvat/docs/manual/advanced/dataset_manifest/'; const CANVAS_BACKGROUND_COLORS = ['#ffffff', '#f1f1f1', '#e5e5e5', '#d8d8d8', '#CCCCCC', '#B3B3B3', '#999999']; const NEW_LABEL_COLOR = '#b3b3b3'; const LATEST_COMMENTS_SHOWN_QUICK_ISSUE = 3; @@ -103,4 +104,5 @@ export default { DEFAULT_AWS_S3_REGIONS, DEFAULT_GOOGLE_CLOUD_STORAGE_LOCATIONS, OUTSIDE_PIC_URL, + DATASET_MANIFEST_GUIDE_URL, };