From b13a790d9b783a393effb473c91eed9244d86c61 Mon Sep 17 00:00:00 2001 From: sebdet Date: Fri, 15 Nov 2019 17:26:45 +0100 Subject: Fix naming convention Second stage, fix naming convention in UI-react so that it's clearer Issue-ID: CLAMP-552 Change-Id: I1bfd48b55d9e1edf66c0369539718e086a778429 Signed-off-by: sebdet --- .../components/dialogs/Loop/LoopPropertiesModal.js | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js (limited to 'ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js') diff --git a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js new file mode 100644 index 000000000..73946f45d --- /dev/null +++ b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +import React from 'react' +import Button from 'react-bootstrap/Button'; +import Modal from 'react-bootstrap/Modal'; +import Form from 'react-bootstrap/Form'; +import styled from 'styled-components'; +import LoopService from '../../../api/LoopService'; + +const ModalStyled = styled(Modal)` + 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())) + }; + + 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.renderDcaeParameters = this.renderDcaeParameters.bind(this); + this.renderAllParameters = this.renderAllParameters.bind(this); + this.getDcaeParameters = this.getDcaeParameters.bind(this); + } + + componentWillReceiveProps(newProps) { + this.setState({ + loopCache: newProps.loopCache, + temporaryPropertiesJson: JSON.parse(JSON.stringify(newProps.loopCache.getGlobalProperties())) + }); + } + + 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()); + }); + } + + handleChange(event) { + this.setState({temporaryPropertiesJson:{[event.target.name]: JSON.parse(event.target.value)}}); + } + + renderAllParameters() { + return ( +
+ {this.renderDcaeParameters()} +
+
+ ); + } + + getDcaeParameters() { + if (typeof (this.state.temporaryPropertiesJson) !== "undefined") { + return JSON.stringify(this.state.temporaryPropertiesJson["dcaeDeployParameters"]); + } else { + return ""; + } + + } + + renderDcaeParameters() { + return ( + + Deploy Parameters + + + ); + } + + render() { + return ( + + + Model Properties + + {this.renderAllParameters()} + + + + + + ); + } +} -- cgit From edaf4f9e6d0f8e1b95115cc39492c84d730ba1a2 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 16 Apr 2020 00:43:48 +0200 Subject: Add template name to UI Add template name to the UI loop viewer + change color of logs panel Issue-ID: CLAMP-826 Signed-off-by: sebdet Change-Id: I6776729cefc0597067ae8ef722f7d6e488a12cad --- ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js') diff --git a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js index 73946f45d..97b782246 100644 --- a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js +++ b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js @@ -102,7 +102,7 @@ export default class LoopPropertiesModal extends React.Component { render() { return ( - + Model Properties -- cgit From df68db271f23561671a59b1678c39b8ee54cd8e4 Mon Sep 17 00:00:00 2001 From: Ted Humphrey Date: Thu, 16 Apr 2020 17:36:17 +0000 Subject: Minor UI fixes for dialogues and Tosca upload feature Issue-ID: CLAMP-587 Change-Id: I683b62fbd0b15ab5db18c7e1e941ff8cb58cb0f3 Signed-off-by: Ted Humphrey --- ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js') diff --git a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js index 97b782246..c0a2084f5 100644 --- a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js +++ b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js @@ -102,7 +102,7 @@ export default class LoopPropertiesModal extends React.Component { render() { return ( - + Model Properties -- cgit From 14c47dc6bc1bd4632df62fd41b54a8094578d2c7 Mon Sep 17 00:00:00 2001 From: Ted Humphrey Date: Tue, 14 Jul 2020 09:04:01 -0400 Subject: Support disabling of Loop Instance Properties "Save" button Issue-ID: CLAMP-895 Change-Id: I0e8fd70b750a59c14bb8e73407c49cc09f1d2657 Signed-off-by: Ted Humphrey --- ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js') diff --git a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js index c0a2084f5..acd0acade 100644 --- a/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js +++ b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js @@ -48,6 +48,7 @@ export default class LoopPropertiesModal extends React.Component { 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) { @@ -109,7 +110,7 @@ export default class LoopPropertiesModal extends React.Component { {this.renderAllParameters()} - + ); -- cgit