From 62cd4eccdceef6b199f5b194e432aaf05983e90c Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Wed, 25 Mar 2020 18:25:54 +0300 Subject: [PATCH] Fixed: Inconsistent labels between UI and CLI/API --- cvat-ui/src/components/labels-editor/common.ts | 2 +- cvat-ui/src/components/labels-editor/label-form.tsx | 4 ++-- cvat-ui/src/components/labels-editor/labels-editor.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cvat-ui/src/components/labels-editor/common.ts b/cvat-ui/src/components/labels-editor/common.ts index 91fd1d8b..5ea21f53 100644 --- a/cvat-ui/src/components/labels-editor/common.ts +++ b/cvat-ui/src/components/labels-editor/common.ts @@ -5,7 +5,7 @@ export interface Attribute { id: number; name: string; - type: string; + input_type: string; mutable: boolean; values: string[]; } diff --git a/cvat-ui/src/components/labels-editor/label-form.tsx b/cvat-ui/src/components/labels-editor/label-form.tsx index 014967a2..85c5ff0d 100644 --- a/cvat-ui/src/components/labels-editor/label-form.tsx +++ b/cvat-ui/src/components/labels-editor/label-form.tsx @@ -76,7 +76,7 @@ class LabelForm extends React.PureComponent { return { name: formValues.attrName[key], - type: formValues.type[key], + input_type: formValues.type[key], mutable: formValues.mutable[key], id: label && index < label.attributes.length ? label.attributes[index].id : key, @@ -136,7 +136,7 @@ class LabelForm extends React.PureComponent { private renderAttributeTypeInput(key: number, attr: Attribute | null): JSX.Element { const locked = attr ? attr.id >= 0 : false; - const type = attr ? attr.type.toUpperCase() : AttributeType.SELECT; + const type = attr ? attr.input_type.toUpperCase() : AttributeType.SELECT; const { form } = this.props; return ( diff --git a/cvat-ui/src/components/labels-editor/labels-editor.tsx b/cvat-ui/src/components/labels-editor/labels-editor.tsx index 06890d75..28274e34 100644 --- a/cvat-ui/src/components/labels-editor/labels-editor.tsx +++ b/cvat-ui/src/components/labels-editor/labels-editor.tsx @@ -73,7 +73,7 @@ export default class LabelsEditor { id: attr.id || idGenerator(), name: attr.name, - type: attr.input_type, + input_type: attr.input_type, mutable: attr.mutable, values: [...attr.values], } @@ -207,7 +207,7 @@ export default class LabelsEditor { name: attr.name, id: attr.id < 0 ? undefined : attr.id, - input_type: attr.type.toLowerCase(), + input_type: attr.input_type.toLowerCase(), default_value: attr.values[0], mutable: attr.mutable, values: [...attr.values],