Tal Nisan has uploaded a new change for review.

Change subject: webadmin: Disable destroy on Storage Domain when active
......................................................................

webadmin: Disable destroy on Storage Domain when active

When a Storage Domain is in active status the destory action should be
greyed out otherwise a destory command is sent to the backend only to
fail the canDo for the Storage being in active status

Change-Id: Ie5259575fa71cbad74ca93c7be979ed607cf258d
Signed-off-by: Tal Nisan <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/24/13524/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
index f9c196c..baff656 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
@@ -100,6 +100,7 @@
 
     private UICommand privateEditCommand;
 
+    @Override
     public UICommand getEditCommand()
     {
         return privateEditCommand;
@@ -1112,7 +1113,8 @@
         getRemoveCommand().setIsExecutionAllowed(items.size() == 1
                 && Linq.FindAllStorageDomainsBySharedStatus(items, 
StorageDomainSharedStatus.Unattached).size() == items.size());
 
-        getDestroyCommand().setIsExecutionAllowed(item != null && items.size() 
== 1);
+        getDestroyCommand().setIsExecutionAllowed(item != null && items.size() 
== 1
+                && item.getStatus() != StorageDomainStatus.Active);
 
         // System tree dependent actions.
         boolean isAvailable =


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

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

Reply via email to