mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Add simulator dialog field check fixed
This commit is contained in:
parent
3f1913dd49
commit
56da378014
1 changed files with 3 additions and 3 deletions
|
@ -63,7 +63,7 @@ class NewSimulatorDialog extends React.Component {
|
|||
}
|
||||
|
||||
resetState() {
|
||||
this.setState({ name: '', endpoint: 'http://', uuid: '' });
|
||||
this.setState({ name: '', endpoint: 'http://', uuid: this.uuidv4()});
|
||||
}
|
||||
|
||||
validateForm(target) {
|
||||
|
@ -79,7 +79,7 @@ class NewSimulatorDialog extends React.Component {
|
|||
uuid = false;
|
||||
}
|
||||
|
||||
this.valid = name || uuid;
|
||||
this.valid = name && uuid;
|
||||
|
||||
// return state to control
|
||||
if (target === 'name') return name ? "success" : "error";
|
||||
|
@ -110,7 +110,7 @@ class NewSimulatorDialog extends React.Component {
|
|||
</FormGroup>
|
||||
<FormGroup controlId="uuid" validationState={this.validateForm('uuid')}>
|
||||
<ControlLabel>UUID</ControlLabel>
|
||||
<FormControl type="text" placeholder="Enter uuid" defaultValue={this.uuidv4()} onChange={(e) => this.handleChange(e)} />
|
||||
<FormControl type="text" placeholder="Enter uuid" value={this.state.uuid} onChange={(e) => this.handleChange(e)} />
|
||||
<FormControl.Feedback />
|
||||
</FormGroup>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Reference in a new issue