Bug fixes: Propagation from the latest frame, number attribute validation (#1800)

* Improved messages for number attribute validation, fixed propagation from the latest frame, fixed checking of a number attribute

* Updated versions

* Updated changelog
main
Boris Sekachev 6 years ago committed by GitHub
parent ae3b06b465
commit db24f93d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Wrong resolution for resizing a shape (<https://github.com/opencv/cvat/pull/1667>)
- React warning because of not unique keys in labels viewer (<https://github.com/opencv/cvat/pull/1727>)
- A couple of exceptions in AAM related with early object activation (<https://github.com/opencv/cvat/pull/1755>)
- Propagation from the latest frame (<https://github.com/opencv/cvat/pull/1800>)
- Number attribute value validation (didn't work well with floats) (<https://github.com/opencv/cvat/pull/1800>)
### Security

@ -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": {

@ -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);
}

@ -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) {

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.4.0",
"version": "1.4.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -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": {

@ -239,21 +239,27 @@ class LabelForm extends React.PureComponent<Props, {}> {
.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();

Loading…
Cancel
Save