frontend components pass actual readOnly and docString values to backend

This commit is contained in:
Mose Müller 2024-03-27 12:03:24 +01:00
parent e4f5374783
commit 31f280c9cb
4 changed files with 15 additions and 8 deletions

View File

@ -91,7 +91,8 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
enum: enumDict,
value: event.target.value,
full_access_path: fullAccessPath,
readonly: true
readonly: attribute.readonly,
doc: attribute.doc
})
}>
{Object.entries(enumDict).map(([key, val]) => (

View File

@ -249,7 +249,8 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
type: type,
value: Number(newValue),
full_access_path: fullAccessPath,
readonly: true
readonly: readOnly,
doc: docString
});
return;
} else {
@ -263,7 +264,8 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
type: type,
value: Number(newValue),
full_access_path: fullAccessPath,
readonly: true
readonly: readOnly,
doc: docString
});
}
@ -280,7 +282,8 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
type: type,
value: Number(inputString),
full_access_path: fullAccessPath,
readonly: true
readonly: readOnly,
doc: docString
});
}
};

View File

@ -68,7 +68,8 @@ export const SliderComponent = React.memo((props: SliderComponentProps) => {
type: value.type,
value: newNumber,
full_access_path: `${fullAccessPath}.value`,
readonly: value.readonly
readonly: value.readonly,
doc: docString
});
};
@ -141,7 +142,7 @@ export const SliderComponent = React.memo((props: SliderComponentProps) => {
<NumberComponent
isInstantUpdate={isInstantUpdate}
fullAccessPath={`${fullAccessPath}.value`}
docString=""
docString={docString}
readOnly={valueReadOnly}
type="float"
value={valueMagnitude}

View File

@ -59,7 +59,8 @@ export const StringComponent = React.memo((props: StringComponentProps) => {
type: 'str',
value: inputString,
full_access_path: fullAccessPath,
readonly: true
readonly: readOnly,
doc: docString
});
event.preventDefault();
}
@ -71,7 +72,8 @@ export const StringComponent = React.memo((props: StringComponentProps) => {
type: 'str',
value: inputString,
full_access_path: fullAccessPath,
readonly: true
readonly: readOnly,
doc: docString
});
}
};