1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

time shows in plot edit dialog, closes #247

This commit is contained in:
Sonja Happ 2020-07-15 11:18:29 +02:00
parent 765a0a61af
commit 63ac373191

View file

@ -23,7 +23,7 @@ class EditWidgetTimeControl extends Component {
super(props);
this.state = {
widget: {
widget: {
}
};
}
@ -36,10 +36,23 @@ class EditWidgetTimeControl extends Component {
render() {
let parts = this.props.controlId.split('.');
let isCustomProperty = true;
if (parts.length === 1){
isCustomProperty = false;
}
return (
<FormGroup controlId= {this.props.controlId}>
<FormLabel>Time</FormLabel>
<FormControl type="number" min="1" max="300" placeholder="Enter time" value={this.state.widget[this.props.controlId]} onChange={(e) => this.props.handleChange(e)} />
<FormControl
type="number"
min="1"
max="300"
placeholder="Enter time"
value={isCustomProperty ? this.state.widget[parts[0]][parts[1]] : this.state.widget[this.props.controlId]}
onChange={(e) => this.props.handleChange(e)}
/>
<FormText>Time in seconds</FormText>
</FormGroup>
);