Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug: wrong attribute is removed in label constructor #2436

Merged
merged 5 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Django templates for email and user guide (<https://github.com/openvinotoolkit/cvat/pull/2412>)
- Saving relative paths in dummy chunks instead of absolute (<https://github.com/openvinotoolkit/cvat/pull/2424>)
- Objects with a specific label cannot be displayed if at least one tag with the label exist (<https://github.com/openvinotoolkit/cvat/pull/2435>)
- Wrong attribute can be removed in labels editor (<https://github.com/openvinotoolkit/cvat/pull/2436>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 5 additions & 3 deletions cvat-ui/src/components/labels-editor/label-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -318,9 +320,9 @@ class LabelForm extends React.PureComponent<Props, {}> {
);
}

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 (
<Form.Item key={key}>
Expand Down