ofri masad has uploaded a new change for review.

Change subject: webadmin: merge the 2 SPM columns into 1 (#845320)
......................................................................

webadmin: merge the 2 SPM columns into 1 (#845320)

https://bugzilla.redhat.com/845320

The two columns - "SPM Status", "SPM Priority" were merged.
New column is called "SPM"
For a host which is Contending or SPM - the status is shown.
For other host - the priority is shown (Low, Normal, High, Custom)

The numberes behind the priority were drop from the column and the 'Edit
Host' -> SPM subtab.

Change-Id: I1db81336eac01ea2e713912a37e5bec90e10dfd5
Signed-off-by: Ofri Masad <oma...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
3 files changed, 13 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/7170/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
index fc3a310..5584964 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
@@ -536,10 +536,10 @@
         EntityModel neverItem = new EntityModel("Never", neverValue); 
//$NON-NLS-1$
         items.add(neverItem);
         int lowValue = defaultSpmPriority / 2;
-        items.add(new EntityModel("Low (" + lowValue + ")", lowValue)); 
//$NON-NLS-1$ //$NON-NLS-2$
-        items.add(new EntityModel("Normal (" + defaultSpmPriority + ")", 
defaultSpmPriority)); //$NON-NLS-1$ //$NON-NLS-2$
+        items.add(new EntityModel("Low", lowValue)); //$NON-NLS-1$ 
//$NON-NLS-2$
+        items.add(new EntityModel("Normal", defaultSpmPriority)); 
//$NON-NLS-1$ //$NON-NLS-2$
         int highValue = defaultSpmPriority + (maxSpmPriority - 
defaultSpmPriority) / 2;
-        items.add(new EntityModel("High (" + highValue + ")", highValue)); 
//$NON-NLS-1$ //$NON-NLS-2$
+        items.add(new EntityModel("High", highValue)); //$NON-NLS-1$ 
//$NON-NLS-2$
 
         // Determine whether to set custom SPM priority, and where.
         EntityModel selectedItem = null;
@@ -555,7 +555,7 @@
                 selectedItem = items.get(i);
                 break;
             } else if (prevValue != null && value > prevValue && value < 
currentValue) {
-                EntityModel customItem = new EntityModel("Custom (" + value + 
")", value);//$NON-NLS-1$ //$NON-NLS-2$
+                EntityModel customItem = new EntityModel("Custom", 
value);//$NON-NLS-1$ //$NON-NLS-2$
 
                 items.add(i, customItem);
                 selectedItem = customItem;
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
index 44b801c..e103aac 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
@@ -959,7 +959,7 @@
     @DefaultStringValue("Network")
     String networkHost();
 
-    @DefaultStringValue("SPM priority")
+    @DefaultStringValue("SPM")
     String spmPriorityHost();
 
     @DefaultStringValue("SpmStatus")
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
index d36a04b..d926b5f 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
@@ -178,28 +178,24 @@
                     int lowValue = defaultSpmPriority / 2;
                     int highValue = defaultSpmPriority + (maxSpmPriority - 
defaultSpmPriority) / 2;
 
+                    if (object.getspm_status() != VdsSpmStatus.None){
+                        return object.getspm_status().name();
+                    }
+
                     if (value == -1) {
                         return constants.spmNeverText();
                     } else if (value == lowValue) {
-                        return constants.spmLowText() + " (" + lowValue + ")"; 
//$NON-NLS-1$ //$NON-NLS-2$
+                        return constants.spmLowText(); //$NON-NLS-1$ 
//$NON-NLS-2$
                     } else if (value == defaultSpmPriority) {
-                        return constants.spmNormalText() + " (" + 
defaultSpmPriority + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+                        return constants.spmNormalText(); //$NON-NLS-1$ 
//$NON-NLS-2$
                     } else if (value == highValue) {
-                        return constants.spmHighText() + " (" + highValue + 
")"; //$NON-NLS-1$ //$NON-NLS-2$
+                        return constants.spmHighText(); //$NON-NLS-1$ 
//$NON-NLS-2$
                     }
 
-                    return "Custom (" + value + ")"; //$NON-NLS-1$ 
//$NON-NLS-2$
+                    return "Custom"; //$NON-NLS-1$ //$NON-NLS-2$
                 }
             };
             getTable().addColumn(spmColumn, constants.spmPriorityHost(), 
"80px"); //$NON-NLS-1$
-
-            TextColumnWithTooltip<VDS> spmStatusColumn = new EnumColumn<VDS, 
VdsSpmStatus>() {
-                @Override
-                public VdsSpmStatus getRawValue(VDS object) {
-                    return object.getspm_status();
-                }
-            };
-            getTable().addColumn(spmStatusColumn, constants.spmStatusHost());
         }
 
         getTable().addActionButton(new 
WebAdminButtonDefinition<VDS>(constants.newHost()) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1db81336eac01ea2e713912a37e5bec90e10dfd5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to