Liron Aravot has uploaded a new change for review.

Change subject: webadmin: disable 'Remove' for OVF store not in ILLEGAL status
......................................................................

webadmin: disable 'Remove' for OVF store not in ILLEGAL status

Currently when OVF store isn't in ILLEGAL status it can't be removed,
this patch greys out the remove button in the webadmin in that case.

Change-Id: Ie2defe1bc6dfb1a770546bc664bb141d0923a1fa
Bug-Url: https://bugzilla.redhat.com/1131845
Signed-off-by: Liron Aravot <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java
1 file changed, 11 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/31954/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java
index cd2f6a6..a685078 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java
@@ -585,11 +585,18 @@
                 return false;
             }
 
-            // check if the disk is locked (if it's a DiskImage)
-            if (disk.getDiskStorageType() == DiskStorageType.IMAGE
-                    && ((DiskImage) disk).getImageStatus() == 
ImageStatus.LOCKED) {
-                return false;
+            if (disk.getDiskStorageType() == DiskStorageType.IMAGE) {
+                ImageStatus imageStatus = ((DiskImage) disk).getImageStatus();
+                if (imageStatus == ImageStatus.LOCKED) {
+                    return false;
+                }
+
+                if (disk.isOvfStore() && imageStatus != ImageStatus.ILLEGAL) {
+                    return false;
+                }
             }
+
+
         }
 
         return true;


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2defe1bc6dfb1a770546bc664bb141d0923a1fa
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to