Alona Kaplan has uploaded a new change for review.

Change subject: webadmin: fix the TODOs
......................................................................

webadmin: fix the TODOs

- Using profiles compatability version taken from the VnicProfileView.
- Using getVnicProfilesByDcId query instead of filtering
getAllVnicProfiles.

Also deleted ProfileInfoPanel.java which is not in use anymore.

Change-Id: Ia432883c76e16c52fc395f517e8f9bd8bedfb584
Signed-off-by: Alona Kaplan <alkap...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileListModel.java
D 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/network/ProfileInfoPanel.java
2 files changed, 6 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/17583/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileListModel.java
index ab18c9e..b6ffecc 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileListModel.java
@@ -13,7 +13,6 @@
 import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
 import org.ovirt.engine.core.common.queries.VdcQueryType;
 import org.ovirt.engine.core.compat.Guid;
-import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
 import org.ovirt.engine.ui.frontend.Frontend;
 import org.ovirt.engine.ui.frontend.INewAsyncCallback;
@@ -25,7 +24,6 @@
 import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
 import org.ovirt.engine.ui.uicommonweb.models.ISupportSystemTreeContext;
 import org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel;
-import org.ovirt.engine.ui.uicommonweb.models.SearchableListModel;
 import org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel;
 import org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType;
 import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel;
@@ -66,9 +64,7 @@
             return;
         }
 
-        // TODO - fix
-        // final VnicProfileModel profileModel = new NewVnicProfileModel(this, 
getEntity().getCompatibilityVersion());
-        final VnicProfileModel profileModel = new NewVnicProfileModel(this, 
Version.v3_3);
+        final VnicProfileModel profileModel = new NewVnicProfileModel(this, 
getEntity().getCompatibilityVersion());
         setWindow(profileModel);
 
         initNetworkList(profileModel);
@@ -82,10 +78,8 @@
             return;
         }
 
-        // TODO - fix
-        // final VnicProfileModel profileModel = new 
EditVnicProfileModel(this, getEntity().getCompatibilityVersion(),
-        // getEntity());
-        final VnicProfileModel profileModel = new EditVnicProfileModel(this, 
Version.v3_3, profile);
+        final VnicProfileModel profileModel =
+                new EditVnicProfileModel(this, 
getEntity().getCompatibilityVersion(), profile);
         setWindow(profileModel);
 
         initNetworkList(profileModel);
@@ -198,14 +192,11 @@
         if (treeSelectedNetwork != null) {
             Network network = (Network) treeSelectedNetwork.getEntity();
             AsyncQuery asyncQuery = new AsyncQuery();
-            asyncQuery.setModel(this);
             asyncQuery.asyncCallback = new INewAsyncCallback() {
                 @Override
                 public void onSuccess(Object model, Object returnValue)
                 {
-                    List<VnicProfileView> newItems = (List<VnicProfileView>) 
returnValue;
-                    SearchableListModel searchableListModel = 
(SearchableListModel) model;
-                    searchableListModel.setItems(newItems);
+                    setItems((List<VnicProfileView>) returnValue);
                 }
             };
             AsyncDataProvider.getVnicProfilesByNetworkId(asyncQuery, 
network.getId());
@@ -219,26 +210,14 @@
             StoragePool dc = (StoragePool) treeSelectedDc.getEntity();
 
             AsyncQuery asyncQuery = new AsyncQuery();
-            asyncQuery.setModel(this);
             asyncQuery.asyncCallback = new INewAsyncCallback() {
                 @Override
                 public void onSuccess(Object model, Object returnValue)
                 {
-                    List<VnicProfileView> notFilteredProfiles = 
(List<VnicProfileView>) returnValue;
-                    List<VnicProfileView> filteredProfiles = new 
ArrayList<VnicProfileView>();
-
-                    for (VnicProfileView profile : notFilteredProfiles) {
-                        // TODO - fix
-                        // if 
(profile.getDataCenterName().equals(dc.getName())){
-                        filteredProfiles.add(profile);
-                        // }
-                    }
-
-                    SearchableListModel searchableListModel = 
(SearchableListModel) model;
-                    searchableListModel.setItems(filteredProfiles);
+                    setItems((List<VnicProfileView>) returnValue);
                 }
             };
-            AsyncDataProvider.getAllVnicProfiles(asyncQuery);
+            AsyncDataProvider.getVnicProfilesByDcId(asyncQuery, dc.getId());
         }
     }
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/network/ProfileInfoPanel.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/network/ProfileInfoPanel.java
deleted file mode 100644
index 4cf3651..0000000
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/network/ProfileInfoPanel.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.ovirt.engine.ui.webadmin.section.main.view.tab.network;
-
-import 
org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionWithInheritedPermissionListModelTable;
-import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel;
-import org.ovirt.engine.ui.webadmin.ApplicationConstants;
-
-import com.google.gwt.dom.client.Style.Position;
-import com.google.gwt.dom.client.Style.Unit;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.TabLayoutPanel;
-
-public class ProfileInfoPanel extends TabLayoutPanel {
-
-    private 
PermissionWithInheritedPermissionListModelTable<PermissionListModel> 
permissionsTable;
-    private ApplicationConstants constants;
-
-    public 
ProfileInfoPanel(PermissionWithInheritedPermissionListModelTable<PermissionListModel>
 permissionsTable,
-            ApplicationConstants constants) {
-        super(20, Unit.PX);
-
-        this.constants = constants;
-        this.permissionsTable = permissionsTable;
-
-        permissionsTable.initTable(constants);
-        initPanel();
-        addStyle();
-    }
-
-    private void initPanel() {
-        // Add Tabs
-        add(new ScrollPanel(permissionsTable), constants.profilePermissions());
-    }
-
-    private void addStyle() {
-        getElement().getStyle().setPosition(Position.STATIC);
-    }
-
-}


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

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

Reply via email to