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

generalize edit file control

This commit is contained in:
Sonja Happ 2020-07-08 15:42:40 +02:00
parent 3e78c99771
commit bb09c691f8

View file

@ -49,7 +49,7 @@ class EditFileWidgetControl extends React.Component {
let fileOptions = [];
if (this.state.files.length > 0){
fileOptions.push(
<option key = {0} default>Select image file</option>
<option key = {0} default>Select file</option>
)
fileOptions.push(this.state.files.map((file, index) => (
<option key={index+1} value={file.id}>{file.name}</option>
@ -60,7 +60,7 @@ class EditFileWidgetControl extends React.Component {
return <div>
<FormGroup controlId="file">
<FormLabel>Image</FormLabel>
<FormLabel>File</FormLabel>
<FormControl
as="select"
value={isCustomProperty ? this.props.widget[parts[0]][parts[1]] : this.props.widget[this.props.controlId]}