mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
0dfb06792a
2 changed files with 9 additions and 6 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue