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, enum: enumDict,
value: event.target.value, value: event.target.value,
full_access_path: fullAccessPath, full_access_path: fullAccessPath,
readonly: true readonly: attribute.readonly,
doc: attribute.doc
}) })
}> }>
{Object.entries(enumDict).map(([key, val]) => ( {Object.entries(enumDict).map(([key, val]) => (

View File

@ -249,7 +249,8 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
type: type, type: type,
value: Number(newValue), value: Number(newValue),
full_access_path: fullAccessPath, full_access_path: fullAccessPath,
readonly: true readonly: readOnly,
doc: docString
}); });
return; return;
} else { } else {
@ -263,7 +264,8 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
type: type, type: type,
value: Number(newValue), value: Number(newValue),
full_access_path: fullAccessPath, full_access_path: fullAccessPath,
readonly: true readonly: readOnly,
doc: docString
}); });
} }
@ -280,7 +282,8 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
type: type, type: type,
value: Number(inputString), value: Number(inputString),
full_access_path: fullAccessPath, 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, type: value.type,
value: newNumber, value: newNumber,
full_access_path: `${fullAccessPath}.value`, 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 <NumberComponent
isInstantUpdate={isInstantUpdate} isInstantUpdate={isInstantUpdate}
fullAccessPath={`${fullAccessPath}.value`} fullAccessPath={`${fullAccessPath}.value`}
docString="" docString={docString}
readOnly={valueReadOnly} readOnly={valueReadOnly}
type="float" type="float"
value={valueMagnitude} value={valueMagnitude}

View File

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