Jiří Moskovčák has uploaded a new change for review.

Change subject: webadmin: clean properties when changing the cluster policy
......................................................................

webadmin: clean properties when changing the cluster policy

When user changes cluster policy to 'None' policy the properties
from the previous policy were still visible.

Change-Id: Icb1da2c3d97c63ce6b73cfb3fd68ee7fb05e8ebb
Bug-Url: https://bugzilla.redhat.com/1062234
Signed-off-by: Jiri Moskovcak <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/key_value/KeyValueModel.java
1 file changed, 17 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/25093/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/key_value/KeyValueModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/key_value/KeyValueModel.java
index be3081d..1956014 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/key_value/KeyValueModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/key_value/KeyValueModel.java
@@ -57,23 +57,26 @@
             saveEntity = value;
             return;
         }
+
         if (value != null) {
-            if (value.isEmpty()) {
-                return;
-            }
-            String[] lines = value.split(PROPERTIES_DELIMETER);
-
+            //always reset the list of items when the item changes
             keyValueMap_used = new HashMap<String, String>();
-            String[] splitLine;
-            for (String line : lines) {
-                if (line.isEmpty()) {
-                    continue;
-                }
+            if (!value.isEmpty()) {
+                String[] lines = value.split(PROPERTIES_DELIMETER);
 
-                splitLine = line.split(KEY_VALUE_DELIMETER, 2);
-                String key = splitLine[0];
-                if (allKeyValueMap.containsKey(key)) {
-                    keyValueMap_used.put(key, splitLine[1]);
+                keyValueMap_used = new HashMap<String, String>();
+                String[] splitLine;
+                for (String line : lines) {
+                    if (line.isEmpty()) {
+                        continue;
+                    }
+
+                    splitLine = line.split(KEY_VALUE_DELIMETER, 2);
+                    String key = splitLine[0];
+                    if (allKeyValueMap.containsKey(key)) {
+                        keyValueMap_used.put(key, splitLine[1]);
+                    }
+
                 }
             }
         }


-- 
To view, visit http://gerrit.ovirt.org/25093
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb1da2c3d97c63ce6b73cfb3fd68ee7fb05e8ebb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Jiří Moskovčák <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to