Hello Alona Kaplan, I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/16934 to review the following change. Change subject: webadmin: adding note when removing network with provider. ...................................................................... webadmin: adding note when removing network with provider. If one of the networks is external, user is notified that the networks will only removed from the system and not from the provider. Change-Id: I2f6d90fed3f714b4fed58d94ff54538440a89d59 Signed-off-by: Alona Kaplan <alkap...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/RemoveConfirmationPopupView.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/RemoveNetworksModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java 3 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/34/16934/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/RemoveConfirmationPopupView.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/RemoveConfirmationPopupView.java index 2099689..187683a 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/RemoveConfirmationPopupView.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/RemoveConfirmationPopupView.java @@ -144,6 +144,7 @@ } }); + setNote(object.getNote()); // Bind "Note" object.getPropertyChangedEvent().addListener(new IEventListener() { @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/RemoveNetworksModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/RemoveNetworksModel.java index 5adcc91..c6ac726 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/RemoveNetworksModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/RemoveNetworksModel.java @@ -18,6 +18,7 @@ private final ListModel sourceListModel; + @SuppressWarnings("unchecked") public RemoveNetworksModel(ListModel sourceListModel) { this.sourceListModel = sourceListModel; @@ -26,10 +27,11 @@ setMessage(ConstantsManager.getInstance().getConstants().logicalNetworksMsg()); ArrayList<String> list = new ArrayList<String>(); - for (Object a : sourceListModel.getSelectedItems()) + boolean hasNetworkWithProvider = false; + for (Network network : (Iterable<Network>) sourceListModel.getSelectedItems()) { - if (a instanceof NetworkView) { - NetworkView netView = (NetworkView) a; + if (network instanceof NetworkView) { + NetworkView netView = (NetworkView) network; if (netView.getDescription() == null || netView.getDescription().trim().equals("")) { //$NON-NLS-1$ list.add(ConstantsManager.getInstance() @@ -43,14 +45,17 @@ netView.getDescription())); } - } else if (a instanceof Network) { - Network network = (Network) a; + } else { if (network.getDescription() == null || "".equals(network.getDescription().trim())) { //$NON-NLS-1$ list.add(network.getName()); } else { list.add(StringFormat.format("%1$s (%2$s)", network.getName(), network.getDescription())); //$NON-NLS-1$ } } + + if (network.isExternal()) { + setNote(ConstantsManager.getInstance().getConstants().removeProvidedNetworksNote()); + } } setItems(list); diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java index 913d534..7899aea 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java @@ -1945,6 +1945,9 @@ @DefaultStringValue("The given mappings are of an invalid format.") String interfaceMappingsInvalid(); + @DefaultStringValue("Note: the networks will only be removed from the system, they will remain intact on any external providers.") + String removeProvidedNetworksNote(); + // Gluster Hook @DefaultStringValue("Please select a resolve action to continue") String noResolveActionSelectedGlusterHook(); -- To view, visit http://gerrit.ovirt.org/16934 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f6d90fed3f714b4fed58d94ff54538440a89d59 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches