Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
eae790f2
Commit
eae790f2
authored
Oct 01, 2018
by
Flavio TARSETTI
Browse files
[js][plotter] fix issue to save boolean values and reload them
parent
fd1f1078
Changes
1
Hide whitespace changes
Inline
Side-by-side
conda/js/src/components/ParameterCreate.jsx
View file @
eae790f2
...
...
@@ -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
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment