From d2a4df0b62b6a32c42bac45b4bee344016faa8fb Mon Sep 17 00:00:00 2001 From: sebdet Date: Wed, 26 Feb 2020 15:47:30 -0800 Subject: Add Create loop dialog Add create loop dialog and backend part associated (this is based on this PR https://gerrit.onap.org/r/c/clamp/+/102156) Issue-ID: CLAMP-587 Change-Id: I58524bc2d5bfbf5ca5a3acf5c59823df06fd4cd9 Signed-off-by: sebdet --- ui-react/src/components/dialogs/Policy/PolicyModal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui-react/src/components/dialogs/Policy') diff --git a/ui-react/src/components/dialogs/Policy/PolicyModal.js b/ui-react/src/components/dialogs/Policy/PolicyModal.js index 75ac2c49d..51a6464c3 100644 --- a/ui-react/src/components/dialogs/Policy/PolicyModal.js +++ b/ui-react/src/components/dialogs/Policy/PolicyModal.js @@ -61,14 +61,14 @@ export default class PolicyModal extends React.Component { } else { console.info("NO validation errors found in policy data"); - if (policyInstanceType === 'MICRO-SERVICE-POLICY') { + if (this.state.policyInstanceType === 'MICRO-SERVICE-POLICY') { this.state.loopCache.updateMicroServiceProperties(this.state.policyName, editorData[0]); LoopService.setMicroServiceProperties(this.state.loopCache.getLoopName(), this.state.loopCache.getMicroServiceForName(this.state.policyName)).then(resp => { this.setState({ show: false }); this.props.history.push('/'); this.props.loadLoopFunction(this.state.loopCache.getLoopName()); }); - } else if (policyInstanceType === 'OPERATIONAL-POLICY') { + } else if (this.state.policyInstanceType === 'OPERATIONAL-POLICY') { this.state.loopCache.updateOperationalPolicyProperties(editorData); LoopService.setOperationalPolicyProperties(this.state.loopCache.getLoopName(), this.state.loopCache.getOperationalPolicyForName(this.state.policyName)).then(resp => { this.setState({ show: false }); @@ -92,10 +92,10 @@ export default class PolicyModal extends React.Component { console.debug("Rendering PolicyModal ", this.state.policyName); var toscaModel = {}; var editorData = {}; - if (policyInstanceType === 'MICRO-SERVICE-POLICY') { + if (this.state.policyInstanceType === 'MICRO-SERVICE-POLICY') { toscaModel = this.state.loopCache.getMicroServiceJsonRepresentationForName(this.state.policyName); editorData = this.state.loopCache.getMicroServicePropertiesForName(this.state.policyName); - } else if (policyInstanceType === 'OPERATIONAL-POLICY') { + } else if (this.state.policyInstanceType === 'OPERATIONAL-POLICY') { toscaModel = this.state.loopCache.getOperationalPolicyJsonRepresentationForName(this.state.policyName); editorData = this.state.loopCache.getOperationalPolicyPropertiesForName(this.state.policyName); } -- cgit 1.2.3-korg