Alona Kaplan has uploaded a new change for review.

Change subject: webadmin: Add default description to multiple action result
......................................................................

webadmin: Add default description to multiple action result

Each result on multiple action result list can have multiple canDo action
messages.
Today all the canDo action messages are displayed as a bulk and the user
can't understand which message belongs to which action.

To correlate between the action and the message a description should be set
on the result.
For example if the user is trying to remove multiple vms. The description
of each result should be the vm name.

The errors are displayed in the following way-
description1:
  - msg1
  - msg2
description2:
  - msg1

The problem is that not all the commands set description on the returned
value.

This patch checks if there is description, if not, a default one is set-
"Action #num:"

Change-Id: I25495eedf3ec61e11eb3c2bb075833fbcc8f9537
Signed-off-by: Alona Kaplan <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/FrontendEventsHandlerImpl.java
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/11453/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/FrontendEventsHandlerImpl.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/FrontendEventsHandlerImpl.java
index 0519794..c38ef6d 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/FrontendEventsHandlerImpl.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/FrontendEventsHandlerImpl.java
@@ -59,11 +59,15 @@
 
         List<Message> errors = new ArrayList<Message>();
 
+        int actionNum = 0;
         for (VdcReturnValueBase v : returnValues) {
+            ++actionNum;
             if (isRaiseErrorModalPanel(action, v.getFault()))
             {
                 for (String canDo : v.getCanDoActionMessages()) {
-                    Message msg = new Message(v.getDescription(), canDo);
+                    String description =
+                            (v.getDescription() != null && 
!"".equals(v.getDescription().trim())) || returnValues.size() == 1 ? 
v.getDescription() : "Action " + actionNum; //$NON-NLS-1$ //$NON-NLS-2$
+                    Message msg = new Message(description, canDo);
                     errors.add(msg);
                 }
             }


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

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

Reply via email to