summaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/Policy/PolicyModal.js
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-02-26 15:47:30 -0800
committersebdet <sebastien.determe@intl.att.com>2020-02-27 06:17:02 -0800
commitd2a4df0b62b6a32c42bac45b4bee344016faa8fb (patch)
treea4d49be5501c1016de3af41f7e8935cd5187ec85 /ui-react/src/components/dialogs/Policy/PolicyModal.js
parentc11160ecfdce03091917e2728f80848f4d8feb95 (diff)
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 <sebastien.determe@intl.att.com>
Diffstat (limited to 'ui-react/src/components/dialogs/Policy/PolicyModal.js')
-rw-r--r--ui-react/src/components/dialogs/Policy/PolicyModal.js8
1 files changed, 4 insertions, 4 deletions
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);
}