Alexander Wels has uploaded a new change for review.

Change subject: userportal,webadmin: permission dialog layout
......................................................................

userportal,webadmin: permission dialog layout

- The permission dialog layout was not conducive for i18n.
  This patch modifies the layout so translated messages will
  not change the layout if they are too big.
- Modified the layout of the dialog to be bootstrap grid based
  instead of the manual pixel layout it was before.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1121065

Change-Id: I3b9a694c6aa4bd18256ae1175440d9b9eeca55a1
Signed-off-by: Alexander Wels <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.ui.xml
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml
4 files changed, 83 insertions(+), 113 deletions(-)


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

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.java
index cb820d0..a3fd2f2 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.java
@@ -28,14 +28,14 @@
 import com.google.gwt.event.dom.client.HasKeyPressHandlers;
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.event.shared.HasHandlers;
+import com.google.gwt.resources.client.CssResource;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.HasValue;
-import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RadioButton;
 import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
 
 public abstract class AbstractPermissionsPopupView<T extends 
AdElementListModel> extends AbstractModelBoundPopupView<T> implements 
AbstractPermissionsPopupPresenterWidget.ViewDef<T> {
 
@@ -44,10 +44,14 @@
         ViewUiBinder uiBinder = GWT.create(ViewUiBinder.class);
     }
 
+    public interface Style extends CssResource {
+        String alignBottom();
+    }
+
     /**
      * This is the max width of a column in this dialogs
      */
-    private static final String MAX_COL_WIDTH = "284px"; //$NON-NLS-1$
+    private static final String MAX_COL_WIDTH = "273px"; //$NON-NLS-1$
 
     @UiField
     @WithElementId
@@ -62,10 +66,6 @@
     @Path("namespace.selectedItem")
     @WithElementId("namespace")
     public ListModelListBoxEditor<String> namespaceSelection;
-
-    @UiField
-    @Ignore
-    public Label roleToAssignLabel;
 
     @UiField(provided = true)
     @Path("role.selectedItem")
@@ -93,10 +93,10 @@
     public TextBoxChanger searchStringEditor;
 
     @UiField
-    public SimplePanel everyonePanel;
+    public FlowPanel everyonePanel;
 
     @UiField
-    public HorizontalPanel roleSelectionPanel;
+    public FlowPanel roleSelectionPanel;
 
     @UiField
     public ScrollPanel searchItemsScrollPanel;
@@ -104,6 +104,9 @@
     @UiField
     @Ignore
     Label errorMessage;
+
+    @UiField
+    Style style;
 
     private PopupNativeKeyPressHandler nativeKeyPressHandler;
 
@@ -119,6 +122,9 @@
         initTable(constants);
         specificUserOrGroupRadio.setValue(true);
         everyoneRadio.setValue(false);
+        //Have to add these classes to the searchStringEditor as the UiBinder 
seems to remove them
+        searchStringEditor.addStyleName("form-control"); //$NON-NLS-1$
+        searchStringEditor.addStyleName(style.alignBottom());
         localize(constants);
     }
 
@@ -175,8 +181,6 @@
 
     void localize(CommonApplicationConstants constants) {
         searchButton.setLabel(constants.goPermissionsPopup());
-        namespaceSelection.setLabel(constants.namespacePermissionsPopup());
-
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.ui.xml
index ad66833..8e05230 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/permissions/AbstractPermissionsPopupView.ui.xml
@@ -2,100 +2,83 @@
 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
 <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
     xmlns:g="urn:import:com.google.gwt.user.client.ui" 
xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"
-    xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" 
xmlns:w="urn:import:org.ovirt.engine.ui.common.widget">
+    xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" 
xmlns:w="urn:import:org.ovirt.engine.ui.common.widget"
+    xmlns:b="urn:import:org.gwtbootstrap3.client.ui">
 
     <ui:with field='constants' 
type='org.ovirt.engine.ui.common.CommonApplicationConstants' />
 
-    <ui:style>
-        .mainLabel {
-            font-weight: bold;
-            padding: 5px;
-        }
-
-        .goButton {
-            float: left;
-            height: 25px;
-            margin-left: 5px;
-            margin-top: 3px;
-        }
-
-        .searchItemsPanel {
-            width: 100%;
-            height: 70%;
-            border-bottom: 1px solid #BBBBBB;
-            border-top: 1px solid #BBBBBB;
-        }
-
-        .searchStringEditor {
-            width: 200px;
-            height: 18px;
-            margin-left: 5px;
-            margin-top: 3px;
-            margin-bottom: 3px;
-        }
-
-        .profileSelection {
-            width: 320px;
-            height: 30px;
-        }
-
-        .namespaceSelection {
-            width: 330px;
-            height: 30px;
-        }
-
-        .everyonePanel {
-            height: 30px;
-            margin-top: 3px;
-        }
-
-        .searchStringPanel {
-            width: 860px;
-            height: 30px;
-        }
-
-        .rolePanel {
-            height: 9%;
-        }
-
-        .errorPanel {
-            width: 100%;
-            text-align: center;
+    <ui:style 
type="org.ovirt.engine.ui.common.view.popup.permissions.AbstractPermissionsPopupView.Style">
+        .alignBottom {
+            margin-top: 25px;
         }
 
         .errorLabel {
             color: #CD2127;
         }
+
+        .gridRow {
+            margin-top: 10px;
+        }
+
+        .searchItemsPanel {
+            width: 100%;
+            height: 270px;
+            border-bottom: 1px solid #BBBBBB;
+            border-top: 1px solid #BBBBBB;
+        }
+
+        .grid {
+            height: 250px;
+        }
     </ui:style>
 
     <d:SimpleDialogPanel width="900px" height="500px">
         <d:content>
-            <g:FlowPanel>
-                <g:SimplePanel ui:field="everyonePanel" 
addStyleNames="{style.everyonePanel}">
-                    <g:HorizontalPanel verticalAlignment="ALIGN_MIDDLE">
-                        <g:RadioButton name="everyoneOrSpecific" 
ui:field="specificUserOrGroupRadio" 
text="{constants.specificUserGroupPermission}"></g:RadioButton>
-                        <g:RadioButton name="everyoneOrSpecific" 
ui:field="everyoneRadio" text="{constants.everyonePermission}"></g:RadioButton>
-                    </g:HorizontalPanel>
-                </g:SimplePanel>
-                <g:HorizontalPanel verticalAlignment="ALIGN_MIDDLE" 
addStyleNames="{style.searchStringPanel}">
-                    <e:ListModelListBoxEditor 
addStyleNames="{style.profileSelection}" 
label="{constants.searchPermissionsPopup}" ui:field="profileSelection" />
-                    <e:ListModelListBoxEditor 
addStyleNames="{style.namespaceSelection}" 
label="{constants.namespacePermissionsPopup}" ui:field="namespaceSelection" />
-                    <e:TextBoxChanger 
addStyleNames="{style.searchStringEditor}" ui:field="searchStringEditor" />
-                    <w:UiCommandButton ui:field="searchButton" 
addStyleNames="{style.goButton} appv_searchButton_pfly_fix" />
-                </g:HorizontalPanel>
-                <g:ScrollPanel ui:field="searchItemsScrollPanel" 
addStyleNames="{style.searchItemsPanel}">
-                    <e:EntityModelCellTable ui:field="searchItems" />
-                </g:ScrollPanel>
-                <g:HorizontalPanel ui:field="roleSelectionPanel" 
addStyleNames="{style.rolePanel} ts10">
-                    <g:Label ui:field="roleToAssignLabel" 
addStyleNames="{style.mainLabel}" 
text="{constants.roleToAssignPermissionsPopup}" />
-                    <e:ListModelListBoxEditor ui:field="roleSelection" />
-                </g:HorizontalPanel>
-                <g:HorizontalPanel addStyleNames="{style.errorPanel}">
-                    <g:cell horizontalAlignment="CENTER">
+            <b:Container>
+                <b:Row>
+                    <g:FlowPanel ui:field="everyonePanel">
+                        <b:Column size="LG_3">
+                            <g:RadioButton name="everyoneOrSpecific" 
ui:field="specificUserOrGroupRadio" 
text="{constants.specificUserGroupPermission}"></g:RadioButton>
+                        </b:Column>
+                        <b:Column size="LG_3">
+                            <g:RadioButton name="everyoneOrSpecific" 
ui:field="everyoneRadio" text="{constants.everyonePermission}"></g:RadioButton>
+                        </b:Column>
+                    </g:FlowPanel>
+                </b:Row>
+                <b:Row>
+                    <b:Column size="LG_3">
+                        <e:ListModelListBoxEditor ui:field="profileSelection" 
label="{constants.searchPermissionsPopup}" usePatternFly="true" />
+                    </b:Column>
+                    <b:Column size="LG_3">
+                        <e:ListModelListBoxEditor 
ui:field="namespaceSelection" label="{constants.namespacePermissionsPopup}" 
usePatternFly="true" />
+                    </b:Column>
+                    <b:Column size="LG_3">
+                        <e:TextBoxChanger ui:field="searchStringEditor" 
addStyleNames="{style.alignBottom} form-control" />
+                    </b:Column>
+                    <b:Column size="LG_1">
+                        <w:UiCommandButton ui:field="searchButton" 
addStyleNames="{style.alignBottom}" />
+                    </b:Column>
+                </b:Row>
+                <b:Row addStyleNames="{style.gridRow}">
+                    <b:Column size="LG_12">
+                        <g:ScrollPanel ui:field="searchItemsScrollPanel" 
addStyleNames="{style.searchItemsPanel}">
+                            <e:EntityModelCellTable ui:field="searchItems" />
+                        </g:ScrollPanel>
+                    </b:Column>
+                </b:Row>
+                <b:Row>
+                    <b:Column size="LG_3">
+                        <g:FlowPanel ui:field="roleSelectionPanel">
+                            <e:ListModelListBoxEditor ui:field="roleSelection" 
label="{constants.roleToAssignPermissionsPopup}" usePatternFly="true" />
+                        </g:FlowPanel>
+                    </b:Column>
+                </b:Row>
+                <b:Row>
+                    <b:Column size="LG_12">
                         <g:Label ui:field="errorMessage" 
addStyleNames="{style.errorLabel}" />
-                    </g:cell>
-                </g:HorizontalPanel>
-            </g:FlowPanel>
+                    </b:Column>
+                </b:Row>
+            </b:Container>
         </d:content>
     </d:SimpleDialogPanel>
 
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
index 3824165..501605f 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
@@ -44,8 +44,6 @@
 
         String labelEnabled();
 
-        String labelEnabledPatternFly();
-
         String labelDisabled();
 
         String labelHidden();
@@ -122,9 +120,7 @@
             // set the style to the bootstrap / patternfly style
             setContentWidgetStyleName(PatternflyConstants.FORM_CONTROL);
             // Set the content width back to default.
-            addLabelStyleName("label col-sm-2 col-md-2 control-label"); 
//$NON-NLS-1$
-            addContentWidgetContainerStyleName("col-sm-10 col-md-10"); 
//$NON-NLS-1$
-            
wrapperPanel.getElement().addClassName(PatternflyConstants.FORM_GROUP);
+            addLabelStyleName("label control-label"); //$NON-NLS-1$
             wrapperPanel.getElement().removeClassName(style.wrapper());
             
contentWidgetContainer.asWidget().removeStyleName(style.contentWidget());
         }
@@ -255,19 +251,9 @@
         contentWidget.setEnabled(enabled);
 
         if (enabled) {
-            if (usePatternFly) {
-                getLabelElement().replaceClassName(style.labelDisabled(), 
style.labelEnabledPatternFly());
-            } else {
-                getLabelElement().replaceClassName(style.labelDisabled(), 
style.labelEnabled());
-            }
+            getLabelElement().replaceClassName(style.labelDisabled(), 
style.labelEnabled());
         } else {
-            if (usePatternFly) {
-                
getLabelElement().replaceClassName(style.labelEnabledPatternFly(), 
style.labelDisabled());
-                // In case the style got added somewhere else, remove it.
-                getLabelElement().removeClassName(style.labelEnabled());
-            } else {
-                getLabelElement().replaceClassName(style.labelEnabled(), 
style.labelDisabled());
-            }
+            getLabelElement().replaceClassName(style.labelEnabled(), 
style.labelDisabled());
         }
 
         if (!keepTitleOnSetEnabled) {
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml
index fd0f3f4..5eeb86c 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml
@@ -10,7 +10,7 @@
 
         .label {
             font-size: 13px;
-            padding: 0 5px;
+            padding: 0 0px;
             font-family: Arial, sans-serif;
             line-height: 30px;
         }
@@ -19,9 +19,6 @@
             color: #333333;
         }
 
-        .labelEnabledPatternFly {
-            color: #fff;
-        }
         .labelDisabled {
             color: gray;
         }


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

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

Reply via email to