diff --git a/CHANGELOG.md b/CHANGELOG.md index 93db8bb5..d28c576e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Wrong resolution for resizing a shape () - React warning because of not unique keys in labels viewer () - A couple of exceptions in AAM related with early object activation () +- Propagation from the latest frame () +- Number attribute value validation (didn't work well with floats) () ### Security diff --git a/cvat-core/package.json b/cvat-core/package.json index 5c62139a..29bc84cd 100644 --- a/cvat-core/package.json +++ b/cvat-core/package.json @@ -1,6 +1,6 @@ { "name": "cvat-core", - "version": "3.0.0", + "version": "3.0.1", "description": "Part of Computer Vision Tool which presents an interface for client-side integration", "main": "babel.config.js", "scripts": { diff --git a/cvat-core/src/annotations-collection.js b/cvat-core/src/annotations-collection.js index 1d9fc0fc..5dd85107 100644 --- a/cvat-core/src/annotations-collection.js +++ b/cvat-core/src/annotations-collection.js @@ -797,15 +797,17 @@ .concat(imported.tracks) .concat(imported.shapes); - this.history.do(HistoryActions.CREATED_OBJECTS, () => { - importedArray.forEach((object) => { - object.removed = true; - }); - }, () => { - importedArray.forEach((object) => { - object.removed = false; - }); - }, importedArray.map((object) => object.clientID), objectStates[0].frame); + if (objectStates.length) { + this.history.do(HistoryActions.CREATED_OBJECTS, () => { + importedArray.forEach((object) => { + object.removed = true; + }); + }, () => { + importedArray.forEach((object) => { + object.removed = false; + }); + }, importedArray.map((object) => object.clientID), objectStates[0].frame); + } return importedArray.map((value) => value.clientID); } diff --git a/cvat-core/src/annotations-objects.js b/cvat-core/src/annotations-objects.js index c5d0e035..ef828653 100644 --- a/cvat-core/src/annotations-objects.js +++ b/cvat-core/src/annotations-objects.js @@ -156,8 +156,7 @@ if (type === AttributeType.NUMBER) { return +value >= +values[0] - && +value <= +values[1] - && !((+value - +values[0]) % +values[2]); + && +value <= +values[1]; } if (type === AttributeType.CHECKBOX) { diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index f521fbce..6c222da0 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 0db6a04d..6aa9558b 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.4.0", + "version": "1.4.1", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/labels-editor/label-form.tsx b/cvat-ui/src/components/labels-editor/label-form.tsx index c9a60fde..b40e0b8a 100644 --- a/cvat-ui/src/components/labels-editor/label-form.tsx +++ b/cvat-ui/src/components/labels-editor/label-form.tsx @@ -239,21 +239,27 @@ class LabelForm extends React.PureComponent { .split(';') .map((number): number => Number.parseFloat(number)); if (numbers.length !== 3) { - callback('Invalid input'); + callback('Three numbers are expected'); } for (const number of numbers) { if (Number.isNaN(number)) { - callback('Invalid input'); + callback(`"${number}" is not a number`); } } - if (numbers[0] >= numbers[1]) { - callback('Invalid input'); + const [min, max, step] = numbers; + + if (min >= max) { + callback('Minimum must be less than maximum'); + } + + if (max - min < step) { + callback('Step must be less than minmax difference'); } - if (+numbers[1] - +numbers[0] < +numbers[2]) { - callback('Invalid input'); + if (step <= 0) { + callback('Step must be a positive number'); } callback();