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>
diff --git a/ui-react/src/components/dialogs/Policy/PolicyModal.js b/ui-react/src/components/dialogs/Policy/PolicyModal.js
index 75ac2c4..51a6464 100644
--- a/ui-react/src/components/dialogs/Policy/PolicyModal.js
+++ b/ui-react/src/components/dialogs/Policy/PolicyModal.js
@@ -61,14 +61,14 @@
 		}
 		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 @@
 		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);
         }