Lior Vernia has posted comments on this change. Change subject: webadmin: Acknowledge labels in Setup Networks dialog ......................................................................
Patch Set 4: (6 comments) http://gerrit.ovirt.org/#/c/22971/4/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java: Line 543: bondToNic.put(bondName, bondedNics); Line 544: } Line 545: } Line 546: Line 547: // bridge name is either <nic>, <nic.vlanid> or <bond.vlanid> > dosen't it confilct the change in: http://gerrit.ovirt.org/#/c/22970/4/fron Doesn't conflict, just moved it for some reason and it's unnecessary. Fixed. Line 548: String ifName; Line 549: if (dotpos > 0) { Line 550: ifName = nicName.substring(0, dotpos); Line 551: } else { Line 591: } Line 592: } Line 593: Line 594: // does this nic have any labels? Line 595: Set<String> labels = nic.getLabels(); > not sure if related to this patch, but these lines should be refactored (ex Not sure what you mean, like a null-safe version of getLabels()? I can try in a later patch to add a common utility to do that and simplify the code a bit. Line 596: if (labels != null) { Line 597: for (String label : labels) { Line 598: NetworkLabelModel labelModel = labelMap.get(label); Line 599: if (labelModel != null) { http://gerrit.ovirt.org/#/c/22971/4/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java: Line 34: setManagement(true); Line 35: } Line 36: } Line 37: Line 38: public void attachViaLabel() { > should be move down along with the setters/getters. btw, shouldn't accept a Moved. At the moment there's no case where it needs to be detached (these models are always reconstructed, not updated). Line 39: attachedViaLabel = true; Line 40: } Line 41: Line 42: /** http://gerrit.ovirt.org/#/c/22971/4/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkInterfaceModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkInterfaceModel.java: Line 56: public List<LogicalNetworkModel> getItems() { Line 57: return (List<LogicalNetworkModel>) super.getItems(); Line 58: } Line 59: Line 60: public List<NetworkLabelModel> getLabels() { > no need for a setter? (just for the good order..) Convenient to only have it set from the constructor, shouldn't be updated at the moment. Line 61: return labels; Line 62: } Line 63: Line 64: @Override http://gerrit.ovirt.org/#/c/22971/4/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/NetworkGroup.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/NetworkGroup.java: Line 51: SortedSet<LogicalNetworkModel> networks = new TreeSet<LogicalNetworkModel>(nicModel.getItems()); Line 52: for (NetworkLabelModel label : labels) { Line 53: networks.removeAll(label.getNetworks()); Line 54: } Line 55: int networkSize = labels.size() + networks.size(); > maybe worth having some 'total network size' method? (as this calculation i Done Line 56: Line 57: // style Line 58: table.setCellSpacing(5); Line 59: table.getElement().addClassName(style.groupPanel()); Line 84: if (networkSize > 0) { Line 85: flexCellFormatter.setRowSpan(0, 0, networkSize); Line 86: FlexTable networkTable = new FlexTable(); Line 87: Line 88: int i = 0; > * not sure it's more readable than the for loop.. I agree, it's less readable, but I now need to go over two collections sequentially, without resetting my position in networkTable. This seemed like a proper way, let me know if you have an idea for something more readable. Extracted to a method. Line 89: Iterator<NetworkLabelModel> labelIterator = labels.iterator(); Line 90: Iterator<LogicalNetworkModel> networkIterator = networks.iterator(); Line 91: while (labelIterator.hasNext()) { Line 92: networkTable.setWidget(i++, 0, new NetworkLabelPanel(labelIterator.next(), style)); -- To view, visit http://gerrit.ovirt.org/22971 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e7d712fcae59b4e03ff365408161f5472dc235d Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches