Tal Nisan has uploaded a new change for review. Change subject: frontend: Remove redundant comments ......................................................................
frontend: Remove redundant comments Remove redundant comments from frontend modules, most of those comments are there from the initial commit and are redundant Change-Id: I14968ae60efd801e88af60680358bc0241ab8e46 Signed-off-by: Tal Nisan <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/autocomplete/SearchSuggestModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/EventNotificationModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/UserListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/RegexValidation.java 14 files changed, 1 insertion(+), 205 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/28284/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/autocomplete/SearchSuggestModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/autocomplete/SearchSuggestModel.java index ed108cd..015200c 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/autocomplete/SearchSuggestModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/autocomplete/SearchSuggestModel.java @@ -204,12 +204,6 @@ List selectedItem = (List) getSelectedItem(); if (selectedItem != null) { - // SearchString = String.Join(String.Empty, - // selectedItem - // .Cast<SuggestItemPartModel>() - // .Select(a => a.PartString) - // .ToArray() - // ); ArrayList<String> items = new ArrayList<String>(); for (Object item : selectedItem) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java index 91c1fc7..70f92d4 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java @@ -1639,16 +1639,6 @@ validateRngRequiredSource(); - // TODO: async validation for webadmin - // string name = (string)Name.Entity; - - // //Check name unicitate. - // if (String.Compare(name, OriginalName, true) != 0 && !DataProvider.IsClusterNameUnique(name)) - // { - // Name.IsValid = false; - // Name.InvalidityReasons.Add("Name must be unique."); - // } - boolean validService = true; if (getEnableOvirtService().getIsAvailable() && getEnableGlusterService().getIsAvailable()) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java index fac733d..74d8d61 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java @@ -147,8 +147,6 @@ privateRecoveryStorageCommand = value; } - // get { return SelectedItems == null ? new object[0] : SelectedItems.Cast<storage_pool>().Select(a => - // a.id).Cast<object>().ToArray(); } protected Object[] getSelectedKeys() { if (getSelectedItems() == null) @@ -535,11 +533,6 @@ public void activate() { - // Frontend.RunMultipleActions(VdcActionType.ActivateStoragePool, - // SelectedItems.Cast<storage_pool>() - // .Select(a => (VdcActionParametersBase)new StoragePoolParametersBase(a.id)) - // .ToList() - // ); } public void onRemove() diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java index 24b99a4..c870c1e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java @@ -295,14 +295,6 @@ getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() }); - // TODO: add this code to async validate. - // string name = (string)Name.Entity; - // if (String.Compare(name, OriginalName, true) != 0 && !DataProvider.IsDataCenterNameUnique(name)) - // { - // Name.IsValid = false; - // Name.InvalidityReasons.Add("Name must be unique."); - // } - return getName().getIsValid() && getDescription().getIsValid() && getComment().getIsValid() && getVersion().getIsValid(); } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceListModel.java index 7834111..49a770a 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceListModel.java @@ -418,25 +418,6 @@ IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId()); tempVar.setRefresh(getIsQueryFirstTime()); Frontend.getInstance().runQuery(VdcQueryType.GetVdsInterfacesByVdsId, tempVar, _asyncQuery); - - // VdcQueryReturnValue returnValue = Frontend.RunQuery(VdcQueryType.GetVdsInterfacesByVdsId, - // new GetVdsByVdsIdParameters(Entity.vds_id) { Refresh = IsQueryFirstTime }); - - // if (returnValue != null && returnValue.Succeeded) - // { - // List<VdsNetworkInterface> items = new List<VdsNetworkInterface>(); - // foreach (IVdcQueryable item in ((List<IVdcQueryable>)returnValue.ReturnValue)) - // { - // VdsNetworkInterface i = (VdsNetworkInterface)item; - // items.Add(i); - // } - - // UpdateItems(items); - // } - // else - // { - // UpdateItems(new List<VdsNetworkInterface>()); - // } } private void updateItems(Iterable<VdsNetworkInterface> source) @@ -1656,15 +1637,7 @@ { nics[i] = selectedItems.get(i).getName(); } - // var parameters = new AddBondParameters( - // host.vds_id, - // model.Bond.ValueAs<Interface>().name, - // net, - // items.Select(a => a.name).ToArray()) - // { - // BondingOptions = model.BondingOptions.ValueAs<string>(), - // BootProtocol = model.BootProtocol - // }; + AddBondParameters parameters = new AddBondParameters(host.getId(), model.getBond().getSelectedItem(), diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java index 3f3abe3..957bb70 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java @@ -2204,41 +2204,6 @@ return true; } - // @Override - // public void run(TaskContext context) - // { - // switch ((Integer) context.getState()) - // { - // case 1: - // try - // { - // // override default timeout (60 sec) with 10 minutes - // TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(0, 10, 0)); - // try - // { - // new AddDataCenterRM(this); - // scope.Complete(); - // } finally - // { - // scope.dispose(); - // } - // } catch (TransactionAbortedException e) - // { - // // Do nothing. - // } finally - // { - // context.InvokeUIThread(this, 2); - // } - // break; - // - // case 2: - // StopProgress(); - // - // Cancel(); - // break; - // } - // } - private SystemTreeItemModel systemTreeSelectedItem; @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java index 0b79750..98343ca 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java @@ -113,8 +113,6 @@ protected Object[] getSelectedKeys() { - // return SelectedItems == null ? new object[0] : SelectedItems.Cast<vm_pools>().Select(a => - // a.vm_pool_id).Cast<object>().ToArray(); } if (getSelectedItems() == null) { return new Object[0]; diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java index a030557..6af8ffc 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java @@ -186,11 +186,9 @@ private void updateActionAvailability() { - // var items = SelectedItems != null ? SelectedItems.Cast<VM>().ToList() : new List<VM>(); ArrayList<VM> items = getSelectedItems() != null ? Linq.<VM> cast(getSelectedItems()) : new ArrayList<VM>(); - // DetachCommand.IsExecutionAllowed = items.Count > 0 && items.All(a => a.status == VMStatus.Down); boolean value = true; for (VM a : items) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/EventNotificationModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/EventNotificationModel.java index ac5bea2..f43f250 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/EventNotificationModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/EventNotificationModel.java @@ -102,7 +102,6 @@ public void expandAll() { - // EventGroupModels.Each(a => a.IsExpanded = true); for (SelectionTreeNodeModel a : getEventGroupModels()) { a.setIsExpanded(true); @@ -111,7 +110,6 @@ public void collapseAll() { - // EventGroupModels.Each(a => a.IsExpanded = false); for (SelectionTreeNodeModel a : getEventGroupModels()) { a.setIsExpanded(false); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/UserListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/UserListModel.java index 68c8324..696fef9 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/UserListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/UserListModel.java @@ -74,8 +74,6 @@ privateAssignTagsCommand = value; } - // get { return SelectedItems == null ? new object[0] : SelectedItems.Cast<DbUser>().Select(a => - // a.user_id).Cast<object>().ToArray(); } protected Object[] getSelectedKeys() { if (getSelectedItems() == null) @@ -526,83 +524,6 @@ cancel(); } - - // private void AssignTags() - // { - // base.AssignTags(); - - // DbUser user = (DbUser)SelectedItem; - // AssignTagsModel.AttachedTags = DataProvider.GetAttachedTagsToUser(user.user_id); - // } - - // public override void NotifyTagsAttached(IList<tags> tags) - // { - // base.NotifyTagsAttached(tags); - - // var dbUsers = SelectedItems.Cast<DbUser>(); - - // var userIds = dbUsers - // .Where(a => !a.IsGroup) - // .Select(a => a.user_id) - // .ToList(); - - // Frontend.RunMultipleActions(VdcActionType.AttachUserToTag, - // tags.Select(a => - // (VdcActionParametersBase)new AttachEntityToTagParameters(a.tag_id, userIds) - // ) - // .ToList() - // ); - - // var groupIds = dbUsers - // .Where(a => a.IsGroup) - // .Select(a => a.user_id) - // .ToList(); - - // Frontend.RunMultipleActions(VdcActionType.AttachUserGroupToTag, - // tags.Select(a => - // (VdcActionParametersBase)new AttachEntityToTagParameters(a.tag_id, groupIds) - // ) - // .ToList() - // ); - // } - - // public override void NotifyTagsDetached(IList<tags> tags) - // { - // base.NotifyTagsDetached(tags); - - // var dbUsers = SelectedItems.Cast<DbUser>(); - - // var userIds = dbUsers - // .Where(a => !a.IsGroup) - // .Select(a => a.user_id) - // .ToList(); - - // Frontend.RunMultipleActions(VdcActionType.DetachUserFromTag, - // tags.Select(a => - // (VdcActionParametersBase)new AttachEntityToTagParameters(a.tag_id, userIds) - // ) - // .ToList() - // ); - - // var groupIds = dbUsers - // .Where(a => a.IsGroup) - // .Select(a => a.user_id) - // .ToList(); - - // Frontend.RunMultipleActions(VdcActionType.DetachUserGroupFromTag, - // tags.Select(a => - // (VdcActionParametersBase)new AttachEntityToTagParameters(a.tag_id, groupIds) - // ) - // .ToList() - // ); - // } - - // public override void OnSelectionChanged(object item, IList items) - // { - // base.OnSelectionChanged(item, items); - - // UpdateActionAvailability(); - // } @Override protected void onSelectedItemChanged() diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java index b15aad3..d89664e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java @@ -11,8 +11,6 @@ * corresponding HTML. */ public interface ISpice { - // event EventHandler<ErrorCodeEventArgs> Disconnected; - // event EventHandler<SpiceMenuItemEventArgs> MenuItemSelected; Event getDisconnectedEvent(); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java index f4a8b62..4089f1a 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java @@ -214,9 +214,6 @@ private void spice_MenuItemSelected(Object sender, SpiceMenuItemEventArgs e) { if (getEntity() != null) { - // SpiceMenuCommandItem item = menu.Descendants() - // .OfType<SpiceMenuCommandItem>() - // .FirstOrDefault(a => a.Id == e.MenuItemId); SpiceMenuCommandItem item = null; for (SpiceMenuItem a : menu.descendants()) { if (a.getClass() == SpiceMenuCommandItem.class && a.getId() == e.getMenuItemId()) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java index 64166cd..ef353b7 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java @@ -1671,7 +1671,6 @@ } model.setMessage(message); - // model.Items = SelectedItems.Cast<VM>().Select(a => a.vm_name); ArrayList<String> items = new ArrayList<String>(); for (Object item : getSelectedItems()) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/RegexValidation.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/RegexValidation.java index 74b4e95..e27754f 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/RegexValidation.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/RegexValidation.java @@ -5,20 +5,6 @@ @SuppressWarnings("unused") public class RegexValidation implements IValidation { - - // public const string NoSpacesRegex = @"^[^\s]+$"; - // public const string NoSpacesMessage = "This field can't contain spaces."; - // public const string AtLeastOneCharRegex = @"[a-zA-Z]+"; - // public const string AtLeastOneCharMsg = "This field must contain at least one alphabetic character."; - // public const string MemSizeRegex = @"^\d+\s*(m|mb|g|gb){0,1}\s*$"; - // public const string IpAddressRegex = - // @"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"; - // public const string IpAddressMessage = "This field must contain an IP address in format xxx.xxx.xxx.xxx"; - // public const string EmailRegex = @"^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"; - // public const string EmailMessage = "Invalid E-Mail address"; - // public const string MacRegex = @"^([\dabcdef]{2}:?){6}$"; - // public const string MacMessage = "Invalid MAC address"; - private String privateExpression; public String getExpression() @@ -55,8 +41,6 @@ privateIsNegate = value; } - // public bool IgnoreCase { get; set; } - public RegexValidation() { } @@ -70,10 +54,6 @@ { ValidationResult result = new ValidationResult(); - // if (IgnoreCase) - // { - // options = RegexOptions.IgnoreCase; - // } if (value == null) { value = ""; //$NON-NLS-1$ } -- To view, visit http://gerrit.ovirt.org/28284 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14968ae60efd801e88af60680358bc0241ab8e46 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tal Nisan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
