Commit 0dfb0679 authored by Sonja Happ's avatar Sonja Happ

Merge remote-tracking branch 'origin/develop' into develop

parents 12b1df8e 0a29f175
......@@ -80,13 +80,16 @@ class EditImageWidgetControl extends React.Component {
isCustomProperty = false;
}
let fileOptions;
let fileOptions = [];
if (this.props.files.length > 0){
fileOptions = this.props.files.map((file, index) => (
fileOptions.push(
<option key = {0} default>Select image file</option>
)
fileOptions.push(this.props.files.map((file, index) => (
<option key={index+1} value={file.id}>{file.name}</option>
))
)))
} else {
fileOptions.set = <option disabled value style={{ display: 'none' }}>No files found, please upload one first.</option>
fileOptions = <option disabled value style={{ display: 'none' }}>No files found, please upload one first.</option>
}
return <div>
......@@ -94,7 +97,6 @@ class EditImageWidgetControl extends React.Component {
<FormLabel>Image</FormLabel>
<FormControl
as="select"
placeholder="Select image file"
value={isCustomProperty ? this.state.widget[parts[0]][parts[1]] : this.state.widget[this.props.controlId]}
onChange={(e) => this.handleFileChange(e)}>{fileOptions} </FormControl>
</FormGroup>
......
......@@ -48,7 +48,8 @@ class EditWidgetSignalControl extends Component {
return (
<FormGroup controlId="signal">
<FormLabel>Select signal</FormLabel>
<FormControl as="select" placeholder="Select signal" value={this.props.widget.signalIDs[0]} onChange={(e) => this.handleSignalChange(e)}>
<FormControl as="select" value={this.props.widget.signalIDs[0] || ""} onChange={(e) => this.handleSignalChange(e)}>
<option default>Select signal</option>
{
this.props.signals.length === 0 ? (
<option disabled value style={{ display: 'none' }}>No signals available.</option>
......
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