From cf01dffedde045590ff48778d9c19c4ac2e3395e Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 16 Nov 2020 12:13:01 +0300 Subject: [PATCH 1/4] Fixed bug: wrong attribute is removed in label constructor --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- cvat-ui/src/components/labels-editor/label-form.tsx | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index c8a305a6..c4bb41d4 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.0", + "version": "1.10.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 1afed2a4..31de9dcc 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.0", + "version": "1.10.2", "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 b292f41f..3e1a4f58 100644 --- a/cvat-ui/src/components/labels-editor/label-form.tsx +++ b/cvat-ui/src/components/labels-editor/label-form.tsx @@ -18,7 +18,9 @@ import ColorPicker from 'components/annotation-page/standard-workspace/objects-s import { ColorizeIcon } from 'icons'; import patterns from 'utils/validation-patterns'; import consts from 'consts'; -import { equalArrayHead, idGenerator, Label, Attribute } from './common'; +import { + equalArrayHead, idGenerator, Label, Attribute, +} from './common'; export enum AttributeType { SELECT = 'SELECT', @@ -318,9 +320,9 @@ class LabelForm extends React.PureComponent { ); } - private renderAttribute = (key: number, index: number): JSX.Element => { + private renderAttribute = (key: number): JSX.Element => { const { label, form } = this.props; - const attr = label && index < label.attributes.length ? label.attributes[index] : null; + const attr = label ? label.attributes.filter((_attr: any): boolean => _attr.id === key)[0] : null; return ( From 267af7567a24811ecfa0ad71828904e44886eab7 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 16 Nov 2020 12:23:38 +0300 Subject: [PATCH 2/4] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f3fa16..8edae3aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Django templates for email and user guide () - Saving relative paths in dummy chunks instead of absolute() +- Wrong attribute can be removed in labels editor () ### Security From 546e30bb1838dcf1bd4f7f2baf6f9f6d0a71b9f3 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 16 Nov 2020 16:54:49 +0300 Subject: [PATCH 3/4] Fixed package version --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index c4bb41d4..803412bb 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.2", + "version": "1.10.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 31de9dcc..05039ea4 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.2", + "version": "1.10.1", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { From 6580e0169525f0bb3dcd2428e65a717a8dce5d7b Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 17 Nov 2020 09:05:21 +0300 Subject: [PATCH 4/4] Updated version --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 13a43d68..5f253dc6 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.1", + "version": "1.10.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index a023aff6..1ab94046 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.1", + "version": "1.10.2", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": {