Skip to content

Commit ba49fc4

Browse files
authored
Remove limit on maximum number of manifest files that can be added for cloud storage (cvat-ai#5660)
1 parent 4df7c4c commit ba49fc4

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343
- TDB
4444

4545
### Removed
46-
- TDB
46+
- Limit on the maximum number of manifest files that can be added for cloud storage (<https://github.com/opencv/cvat/pull/5660>)
4747

4848
### Fixed
4949
- Helm: Empty password for Redis (<https://github.com/opencv/cvat/pull/5520>)

cvat-ui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cvat-ui",
3-
"version": "1.48.0",
3+
"version": "1.48.1",
44
"description": "CVAT single-page application",
55
"main": "src/index.tsx",
66
"scripts": {

cvat-ui/src/components/create-cloud-storage-page/manifests-manager.tsx

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (C) 2021-2022 Intel Corporation
2+
// Copyright (C) 2023 CVAT.ai Corporation
23
//
34
// SPDX-License-Identifier: MIT
45

5-
import React, { useEffect, useRef, useState } from 'react';
6+
import React, { useEffect } from 'react';
67
import { DeleteOutlined, PlusCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
78
import Button from 'antd/lib/button';
89
import Col from 'antd/lib/col';
910
import Form, { RuleObject } from 'antd/lib/form';
1011
import { FormListFieldData, FormListOperation } from 'antd/lib/form/FormList';
1112
import Input from 'antd/lib/input';
1213
import Row from 'antd/lib/row';
13-
import notification from 'antd/lib/notification';
1414
import Tooltip from 'antd/lib/tooltip';
1515
import config from 'config';
1616

@@ -22,8 +22,6 @@ interface Props {
2222

2323
export default function ManifestsManager(props: Props): JSX.Element {
2424
const { form, manifestNames, setManifestNames } = props;
25-
const maxManifestsCount = useRef(5);
26-
const [limitingAddingManifestNotification, setLimitingAddingManifestNotification] = useState(false);
2725
const { DATASET_MANIFEST_GUIDE_URL } = config;
2826

2927
const updateManifestFields = (): void => {
@@ -40,34 +38,18 @@ export default function ManifestsManager(props: Props): JSX.Element {
4038
updateManifestFields();
4139
}, [manifestNames]);
4240

43-
useEffect(() => {
44-
if (limitingAddingManifestNotification) {
45-
notification.warning({
46-
message: `Unable to add manifest. The maximum number of files is ${maxManifestsCount.current}`,
47-
className: 'cvat-notification-limiting-adding-manifest',
48-
});
49-
}
50-
}, [limitingAddingManifestNotification]);
51-
5241
const onChangeManifestPath = (manifestName: string | undefined, manifestId: number): void => {
5342
if (manifestName !== undefined) {
5443
setManifestNames(manifestNames.map((name, idx) => (idx !== manifestId ? name : manifestName)));
5544
}
5645
};
5746

5847
const onDeleteManifestItem = (key: number): void => {
59-
if (maxManifestsCount.current === manifestNames.length && limitingAddingManifestNotification) {
60-
setLimitingAddingManifestNotification(false);
61-
}
6248
setManifestNames(manifestNames.filter((name, idx) => idx !== key));
6349
};
6450

6551
const onAddManifestItem = (): void => {
66-
if (maxManifestsCount.current <= manifestNames.length) {
67-
setLimitingAddingManifestNotification(true);
68-
} else {
69-
setManifestNames(manifestNames.concat(['']));
70-
}
52+
setManifestNames(manifestNames.concat(['']));
7153
};
7254

7355
return (

0 commit comments

Comments
 (0)