Fixed: Inconsistent labels between UI and CLI/API

main
Boris Sekachev 6 years ago
parent 3f4d6fc8d3
commit 62cd4eccdc

@ -5,7 +5,7 @@
export interface Attribute {
id: number;
name: string;
type: string;
input_type: string;
mutable: boolean;
values: string[];
}

@ -76,7 +76,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
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<Props, {}> {
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 (

@ -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],

Loading…
Cancel
Save