Commit eae790f2 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[js][plotter] fix issue to save boolean values and reload them

parent fd1f1078
......@@ -51,6 +51,19 @@ export default class ParameterCreate extends React.Component<Props, State> {
const params = this.props.params;
const updateParameter = this.props.updateParameter;
let new_param = false;
if (param.type == 'bool')
{
if(typeof(param.default) == 'string')
{
new_param = true;
}
else
{
new_param = false;
}
}
return (
<React.Fragment>
<TypedField
......@@ -332,6 +345,12 @@ export default class ParameterCreate extends React.Component<Props, State> {
<Input
name={`default${ name }`}
type='radio'
checked={param.default && !new_param}
value={true}
onChange={(e) => updateParameter(name, {
...param,
default: JSON.parse(e.target.value)
})}
/>
True
</Label>
......@@ -341,6 +360,12 @@ export default class ParameterCreate extends React.Component<Props, State> {
<Input
name={`default${ name }`}
type='radio'
checked={!param.default && !new_param}
value={false}
onChange={(e) => updateParameter(name, {
...param,
default: JSON.parse(e.target.value)
})}
/>
False
</Label>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment