summaryrefslogtreecommitdiffstats
path: root/runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js')
-rw-r--r--runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js144
1 files changed, 72 insertions, 72 deletions
diff --git a/runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js b/runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js
index acd0acade..69177134b 100644
--- a/runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js
+++ b/runtime/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js
@@ -28,91 +28,91 @@ import styled from 'styled-components';
import LoopService from '../../../api/LoopService';
const ModalStyled = styled(Modal)`
- background-color: transparent;
+ background-color: transparent;
`
export default class LoopPropertiesModal extends React.Component {
- state = {
- show: true,
- loopCache: this.props.loopCache,
- temporaryPropertiesJson: JSON.parse(JSON.stringify(this.props.loopCache.getGlobalProperties()))
- };
+ state = {
+ show: true,
+ loopCache: this.props.loopCache,
+ temporaryPropertiesJson: JSON.parse(JSON.stringify(this.props.loopCache.getGlobalProperties()))
+ };
- constructor(props, context) {
- super(props, context);
+ constructor(props, context) {
+ super(props, context);
- this.handleClose = this.handleClose.bind(this);
- this.handleSave = this.handleSave.bind(this);
- this.handleChange = this.handleChange.bind(this);
+ this.handleClose = this.handleClose.bind(this);
+ this.handleSave = this.handleSave.bind(this);
+ this.handleChange = this.handleChange.bind(this);
- this.renderDcaeParameters = this.renderDcaeParameters.bind(this);
- this.renderAllParameters = this.renderAllParameters.bind(this);
- this.getDcaeParameters = this.getDcaeParameters.bind(this);
- this.readOnly = props.readOnly !== undefined ? props.readOnly : false;
- }
+ this.renderDcaeParameters = this.renderDcaeParameters.bind(this);
+ this.renderAllParameters = this.renderAllParameters.bind(this);
+ this.getDcaeParameters = this.getDcaeParameters.bind(this);
+ this.readOnly = props.readOnly !== undefined ? props.readOnly : false;
+ }
- componentWillReceiveProps(newProps) {
- this.setState({
- loopCache: newProps.loopCache,
- temporaryPropertiesJson: JSON.parse(JSON.stringify(newProps.loopCache.getGlobalProperties()))
- });
- }
+ componentWillReceiveProps(newProps) {
+ this.setState({
+ loopCache: newProps.loopCache,
+ temporaryPropertiesJson: JSON.parse(JSON.stringify(newProps.loopCache.getGlobalProperties()))
+ });
+ }
- handleClose() {
- this.props.history.push('/');
- }
+ handleClose() {
+ this.props.history.push('/');
+ }
- handleSave(event) {
- LoopService.updateGlobalProperties(this.state.loopCache.getLoopName(), this.state.temporaryPropertiesJson).then(resp => {
- this.setState({ show: false });
- this.props.history.push('/');
- this.props.loadLoopFunction(this.state.loopCache.getLoopName());
- });
- }
+ handleSave(event) {
+ LoopService.updateGlobalProperties(this.state.loopCache.getLoopName(), this.state.temporaryPropertiesJson).then(resp => {
+ this.setState({ show: false });
+ this.props.history.push('/');
+ this.props.loadLoopFunction(this.state.loopCache.getLoopName());
+ });
+ }
- handleChange(event) {
- this.setState({temporaryPropertiesJson:{[event.target.name]: JSON.parse(event.target.value)}});
- }
+ handleChange(event) {
+ this.setState({ temporaryPropertiesJson: { [event.target.name]: JSON.parse(event.target.value) } });
+ }
- renderAllParameters() {
- return (<Modal.Body>
- <Form>
- {this.renderDcaeParameters()}
- </Form>
- </Modal.Body>
- );
- }
+ renderAllParameters() {
+ return (<Modal.Body>
+ <Form>
+ { this.renderDcaeParameters() }
+ </Form>
+ </Modal.Body>
+ );
+ }
- getDcaeParameters() {
- if (typeof (this.state.temporaryPropertiesJson) !== "undefined") {
- return JSON.stringify(this.state.temporaryPropertiesJson["dcaeDeployParameters"]);
- } else {
- return "";
- }
+ getDcaeParameters() {
+ if (typeof (this.state.temporaryPropertiesJson) !== "undefined") {
+ return JSON.stringify(this.state.temporaryPropertiesJson["dcaeDeployParameters"]);
+ } else {
+ return "";
+ }
- }
+ }
- renderDcaeParameters() {
- return (
- <Form.Group >
- <Form.Label>Deploy Parameters</Form.Label>
- <Form.Control as="textarea" rows="3" name="dcaeDeployParameters" onChange={this.handleChange} defaultValue={this.getDcaeParameters()}></Form.Control>
- </Form.Group>
- );
- }
+ renderDcaeParameters() {
+ return (
+ <Form.Group>
+ <Form.Label>Deploy Parameters</Form.Label>
+ <Form.Control as="textarea" rows="3" name="dcaeDeployParameters" onChange={ this.handleChange } defaultValue={ this.getDcaeParameters() }></Form.Control>
+ </Form.Group>
+ );
+ }
- render() {
- return (
- <ModalStyled size="lg" show={this.state.show} onHide={this.handleClose} backdrop="static" keyboard={false} >
- <Modal.Header closeButton>
- <Modal.Title>Model Properties</Modal.Title>
- </Modal.Header>
- {this.renderAllParameters()}
- <Modal.Footer>
- <Button variant="secondary" type="null" onClick={this.handleClose}>Cancel</Button>
- <Button variant="primary" type="submit" disabled={this.readOnly} onClick={this.handleSave}>Save Changes</Button>
- </Modal.Footer>
- </ModalStyled>
- );
- }
+ render() {
+ return (
+ <ModalStyled size="lg" show={ this.state.show } onHide={ this.handleClose } backdrop="static" keyboard={ false }>
+ <Modal.Header closeButton>
+ <Modal.Title>Model Properties</Modal.Title>
+ </Modal.Header>
+ { this.renderAllParameters() }
+ <Modal.Footer>
+ <Button variant="secondary" type="null" onClick={ this.handleClose }>Cancel</Button>
+ <Button variant="primary" type="submit" disabled={ this.readOnly } onClick={ this.handleSave }>Save Changes</Button>
+ </Modal.Footer>
+ </ModalStyled>
+ );
+ }
}