Alona Kaplan has posted comments on this change.

Change subject: webadmin: add VnicProfile as main tab
......................................................................


Patch Set 25:

(17 comments)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileListModel.java
Line 64:         {
Line 65:             return;
Line 66:         }
Line 67: 
Line 68:         // TODO - fix
Fixed in http://gerrit.ovirt.org/#/c/17583/
Line 69:         // final VnicProfileModel profileModel = new 
NewVnicProfileModel(this, getEntity().getCompatibilityVersion());
Line 70:         final VnicProfileModel profileModel = new 
NewVnicProfileModel(this, Version.v3_3);
Line 71:         setWindow(profileModel);
Line 72: 


Line 80:         {
Line 81:             return;
Line 82:         }
Line 83: 
Line 84:         // TODO - fix
Fixed in http://gerrit.ovirt.org/#/c/17583/
Line 85:         // final VnicProfileModel profileModel = new 
EditVnicProfileModel(this, getEntity().getCompatibilityVersion(),
Line 86:         // getEntity());
Line 87:         final VnicProfileModel profileModel = new 
EditVnicProfileModel(this, Version.v3_3, profile);
Line 88:         setWindow(profileModel);


Line 100:         ConfirmationModel model = new RemoveVnicProfileModel(this, 
getSelectedItems(), true);
Line 101:         setConfirmWindow(model);
Line 102:     }
Line 103: 
Line 104:     private void initNetworkList(final VnicProfileModel profileModel) 
{
This logic shouldn't reside in VnicProfileModel cause no all the places that 
use the model need to init the network list. For example in Networks->Profiles 
when I use the VninProfileModel the network is already known. There is no need 
to load the network list from the engine.
Line 105:         profileModel.startProgress(null);
Line 106: 
Line 107:         SystemTreeItemModel treeSelectedItem =
Line 108:                 (SystemTreeItemModel) 
CommonModel.getInstance().getSystemTree().getSelectedItem();


Line 133:                             (ArrayList<Network>) 
((VdcQueryReturnValue) ReturnValue).getReturnValue();
Line 134: 
Line 135:                     profileModel.getNetwork().setItems(networks);
Line 136: 
Line 137:                     if (profileModel instanceof EditVnicProfileModel) 
{
See previous comment.
Line 138:                         Network currentNetwork =
Line 139:                                 
findNetwork(profileModel.getProfile().getNetworkId(), networks);
Line 140:                         
profileModel.getNetwork().setSelectedItem(currentNetwork);
Line 141:                         
profileModel.getNetwork().setIsChangable(false);


Line 135:                     profileModel.getNetwork().setItems(networks);
Line 136: 
Line 137:                     if (profileModel instanceof EditVnicProfileModel) 
{
Line 138:                         Network currentNetwork =
Line 139:                                 
findNetwork(profileModel.getProfile().getNetworkId(), networks);
I would still have to do the query. The network id is not enough, I need the 
whole entity...
Line 140:                         
profileModel.getNetwork().setSelectedItem(currentNetwork);
Line 141:                         
profileModel.getNetwork().setIsChangable(false);
Line 142:                     } else {
Line 143:                         
profileModel.getNetwork().setSelectedItem(Linq.firstOrDefault(networks));


Line 149:             Frontend.RunQuery(VdcQueryType.GetAllNetworks, 
queryParams, _asyncQuery);
Line 150:         }
Line 151:     }
Line 152: 
Line 153:     private Network findNetwork(Guid networkId, List<Network> 
networks) {
See previous comment.
Line 154:         for (Network network : networks) {
Line 155:             if (networkId.equals(network.getId())) {
Line 156:                 return network;
Line 157:             }


Line 173:     }
Line 174: 
Line 175:     @Override
Line 176:     public boolean isSearchStringMatch(String searchString) {
Line 177:         return 
searchString.trim().toLowerCase().startsWith("network"); //$NON-NLS-1$
There is no search, so it doesn't matter:)
Fixed it for future use.
Line 178:     }
Line 179: 
Line 180:     @Override
Line 181:     protected void syncSearch() {


Line 178:     }
Line 179: 
Line 180:     @Override
Line 181:     protected void syncSearch() {
Line 182:         // TODO - fix
There is still no search. When there will be one the TODO should be removed.
Line 183:         // SearchParameters tempVar = new 
SearchParameters(getSearchString(), SearchType.Profile);
Line 184:         // tempVar.setMaxCount(getSearchPageSize());
Line 185:         // super.syncSearch(VdcQueryType.Search, tempVar);
Line 186: 


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileTemplateListModel.java
Line 43:         getSearchCommand().execute();
Line 44:     }
Line 45: 
Line 46:     @Override
Line 47:     public void setItems(Iterable value) {
It is listmodel of a subtab- items should be added externally to setItems. 
Therefore I think it is more efficient to leave it as is. But I"ll consider the 
issue later after pushing all the pending patches)
Line 48:         if (value != null) {
Line 49:             List<VmTemplate> itemList = (List<VmTemplate>) value;
Line 50:             Collections.sort(itemList, new Comparator<VmTemplate>() {
Line 51: 


Line 67:         }
Line 68:     }
Line 69: 
Line 70:     @Override
Line 71:     protected void syncSearch() {
There is no SearchableListModel syncSearch mechanism. The syncSearch method is 
empty
Line 72:         if (getEntity() == null)
Line 73:         {
Line 74:             return;
Line 75:         }


Line 100:             getSearchCommand().execute();
Line 101:         }
Line 102:     }
Line 103: 
Line 104:     private void updateActionAvailability() {
There is a big change we will add commands to this model. Therefore I prefer to 
leave this method and its calls.
Line 105:     }
Line 106: 
Line 107:     @Override
Line 108:     protected void onSelectedItemChanged() {


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/VnicProfileVmListModel.java
Line 43:         getSearchCommand().execute();
Line 44:     }
Line 45: 
Line 46:     @Override
Line 47:     public void setItems(Iterable value) {
For now I leave it as is. After we"ll push all the patches I"ll consider it and 
decide if to fix it in a new patch.
Line 48:         if (value != null) {
Line 49:             List<VM> itemList = (List<VM>) value;
Line 50:             Collections.sort(itemList, new Comparator<VM>() {
Line 51: 


Line 67:         }
Line 68:     }
Line 69: 
Line 70:     @Override
Line 71:     protected void syncSearch() {
Why? syncSearch of SerachableListModel does nothing...
Line 72:         if (getEntity() == null)
Line 73:         {
Line 74:             return;
Line 75:         }


Line 100:             getSearchCommand().execute();
Line 101:         }
Line 102:     }
Line 103: 
Line 104:     private void updateActionAvailability() {
Same answer:)
Line 105:     }
Line 106: 
Line 107:     @Override
Line 108:     protected void onSelectedItemChanged() {


....................................................
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
Line 66: 
Line 67:     @DefaultStringValue("Networks")
Line 68:     String networkMainTabLabel();
Line 69: 
Line 70:     @DefaultStringValue("Vnic Profiles")
Fixed to VM Interface Profiles
Line 71:     String vnicProfilesMainTabLabel();
Line 72: 
Line 73:     @DefaultStringValue("Storage")
Line 74:     String storageMainTabLabel();


....................................................
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java
Line 924:                 SubTabProviderNetworkView.class,
Line 925:                 SubTabProviderNetworkPresenter.ProxyDef.class);
Line 926: 
Line 927:         // Profile
Line 928:         bindPresenter(VnicProfileSubTabPanelPresenter.class,
Why not? How will it work without it?
Line 929:                 VnicProfileSubTabPanelPresenter.ViewDef.class,
Line 930:                 VnicProfileSubTabPanelView.class,
Line 931:                 VnicProfileSubTabPanelPresenter.ProxyDef.class);
Line 932:         bindPresenter(SubTabVnicProfilePermissionPresenter.class,


....................................................
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/profile/VnicProfileSubTabPanelView.java
Line 4: import org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel;
Line 5: import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.profile.VnicProfileSubTabPanelPresenter;
Line 6: import org.ovirt.engine.ui.webadmin.widget.tab.SimpleTabPanel;
Line 7: 
Line 8: public class VnicProfileSubTabPanelView extends AbstractTabPanelView 
implements VnicProfileSubTabPanelPresenter.ViewDef {
I see that all the subtabs still use it...
Line 9: 
Line 10:     private final SimpleTabPanel tabPanel = new SimpleTabPanel();
Line 11: 
Line 12:     public VnicProfileSubTabPanelView() {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ied73fa4ecdb58c3224dc78f6641b2d56d55ec73b
Gerrit-PatchSet: 25
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to