Fix updateMsProperties method 33/89133/1
authorWojciech Sliwka <wojciech.sliwka@nokia.com>
Mon, 3 Jun 2019 12:06:27 +0000 (14:06 +0200)
committerWojciech Sliwka <wojciech.sliwka@nokia.com>
Mon, 3 Jun 2019 12:06:27 +0000 (14:06 +0200)
Issue-ID: CLAMP-401
Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Change-Id: I39b17342fa37416eab0b8776a899ce8360be1818

src/main/resources/META-INF/resources/designer/scripts/propertyController.js

index 994e4a7..a8aa83c 100644 (file)
  */
 
 function updateMsProperties(type, newMsProperties) {
-    var newMsProperties = JSON.parse(JSON.stringify(cl_props["microServicePolicies"]));
-    for (p in newMsProperties) {
-        if (newMsProperties[p]["name"] == type) {
-               cl_props["microServicePolicies"][p] = newMsProperties;
+    if (newMsProperties["name"] == type) {
+        for (p in cl_props["microServicePolicies"]) {
+            if (cl_props["microServicePolicies"][p]["name"] == type) {
+                cl_props["microServicePolicies"][p] = newMsProperties;
+            }
         }
     }
 }
@@ -126,4 +127,4 @@ function getLoopLogsArray() {
        return cl_props.loopLogs;
 }
 
-module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsVfProperty,getResourceDetailsVfModuleProperty };
\ No newline at end of file
+module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsVfProperty,getResourceDetailsVfModuleProperty };