mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
remove properties param of IC from edit dialog
This commit is contained in:
parent
ea1b74ea01
commit
b5b5722154
1 changed files with 11 additions and 28 deletions
|
@ -17,7 +17,6 @@
|
|||
|
||||
import React from 'react';
|
||||
import { Form } from 'react-bootstrap';
|
||||
import _ from 'lodash';
|
||||
import Dialog from '../common/dialogs/dialog';
|
||||
import ParametersEditor from '../common/parameters-editor';
|
||||
|
||||
|
@ -36,15 +35,15 @@ class EditICDialog extends React.Component {
|
|||
type: '',
|
||||
category: '',
|
||||
managedexternally: false,
|
||||
startParameterSchema: {},
|
||||
properties: {}
|
||||
startparameterschema: {}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
onClose(canceled) {
|
||||
if (canceled === false) {
|
||||
if (this.valid) {
|
||||
let data = this.props.ic;
|
||||
let data = JSON.parse(JSON.stringify(this.props.ic));
|
||||
|
||||
if (this.state.name != null && this.state.name !== "" && this.state.name !== this.props.ic.name) {
|
||||
data.name = this.state.name;
|
||||
|
@ -69,12 +68,8 @@ class EditICDialog extends React.Component {
|
|||
data.category = this.state.category;
|
||||
}
|
||||
|
||||
if (this.state.startParameterSchema !== {}) {
|
||||
data.startParameterSchema = this.state.startParameterSchema;
|
||||
}
|
||||
|
||||
if (this.state.properties !== {}) {
|
||||
data.properties = this.state.properties;
|
||||
if (this.state.startparameterschema !== {}) {
|
||||
data.startparameterschema = this.state.startparameterschema;
|
||||
}
|
||||
|
||||
data.managedexternally = this.state.managedexternally;
|
||||
|
@ -98,11 +93,7 @@ class EditICDialog extends React.Component {
|
|||
}
|
||||
|
||||
handleStartParameterSchemaChange(data) {
|
||||
this.setState({ startParameterSchema: data });
|
||||
}
|
||||
|
||||
handlePropertiesChange(data) {
|
||||
this.setState({ properties: data });
|
||||
this.setState({ startparameterschema: data });
|
||||
}
|
||||
|
||||
resetState() {
|
||||
|
@ -115,8 +106,7 @@ class EditICDialog extends React.Component {
|
|||
description: this.props.ic.description,
|
||||
category: this.props.ic.category,
|
||||
managedexternally: false,
|
||||
startParameterSchema: this.props.ic.startParameterSchema,
|
||||
properties: this.props.ic.properties,
|
||||
startparameterschema: this.props.ic.startparameterschema,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -196,22 +186,15 @@ class EditICDialog extends React.Component {
|
|||
<Form.Control type="text" placeholder={this.props.ic.description} value={this.state.description || '' } onChange={(e) => this.handleChange(e)} />
|
||||
<Form.Control.Feedback />
|
||||
</Form.Group>
|
||||
<Form.Group controlId='startParameterSchema'>
|
||||
<Form.Group controlId='startparameterschema'>
|
||||
<Form.Label column={false}>Start parameter schema of IC</Form.Label>
|
||||
<ParametersEditor
|
||||
content={this.state.startParameterSchema}
|
||||
disabled={false}
|
||||
content={this.state.startparameterschema}
|
||||
onChange={(data) => this.handleStartParameterSchemaChange(data)}
|
||||
disabled={false}
|
||||
/>
|
||||
</Form.Group>
|
||||
<Form.Group controlId='properties'>
|
||||
<Form.Label column={false}>Properties</Form.Label>
|
||||
<ParametersEditor
|
||||
content={this.state.properties}
|
||||
disabled={true}
|
||||
onChange={(data) => this.handlePropertiesChange(data)}
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
</Form>
|
||||
</Dialog>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue