From ec2d052dd3e698d60d8eddac24325f0f32980fd5 Mon Sep 17 00:00:00 2001 From: Matteo Maiero Date: Mon, 2 Oct 2023 10:26:03 +0200 Subject: [PATCH] fix: fixed UI issues with the modem section (#4869) * fix: Cellular tab activation fix Signed-off-by: MMaiero * fix: wrong management of modem gps and diversity Signed-off-by: MMaiero * fix: applied same fixes also to the wi-fi section Signed-off-by: MMaiero * fix: not managed state Signed-off-by: MMaiero --------- Signed-off-by: MMaiero --- .../kura/web/client/ui/network/NetworkTabsUi.java | 14 ++++++-------- .../kura/web/client/ui/network/TabWirelessUi.java | 5 ----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/NetworkTabsUi.java b/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/NetworkTabsUi.java index 279e803a9dc..ece754a28c1 100644 --- a/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/NetworkTabsUi.java +++ b/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/NetworkTabsUi.java @@ -314,14 +314,14 @@ private void arrangeOptionalTabs() { InterfaceConfigWrapper wrapper = new InterfaceConfigWrapper(this.netIfConfig); if (wrapper.isWireless()) { - showWirelessTabs(); + showWirelessTabs(isIpv4Disabled || isUnmanagedSelected()); if (!isWirelessAP) { includeDhcpNat = false; } } else if (wrapper.isModem()) { includeDhcpNat = false; this.modemGpsTabAnchorItem.setEnabled(wrapper.isGpsSupported() && !isUnmanagedSelected()); - showModemTabs(); + showModemTabs(isIpv4Disabled || isUnmanagedSelected()); } else { showEthernetTabs(); if (wrapper.isLoopback()) { @@ -339,12 +339,12 @@ private void arrangeOptionalTabs() { } } - private void showWirelessTabs() { + private void showWirelessTabs(boolean interfaceNotEnabled) { removeTab(this.modemTabAnchorItem); removeTab(this.modemGpsTabAnchorItem); removeTab(this.modemAntennaTabAnchorItem); - this.wirelessTabAnchorItem.setEnabled(true); + this.wirelessTabAnchorItem.setEnabled(!interfaceNotEnabled); insertTab(this.wirelessTabAnchorItem); if (this.isNet2) { @@ -354,11 +354,11 @@ private void showWirelessTabs() { insertTab(this.dhcp4NatTabAnchorItem); } - private void showModemTabs() { + private void showModemTabs(boolean interfaceNotEnabled) { removeTab(this.wirelessTabAnchorItem); removeTab(this.dhcp4NatTabAnchorItem); - this.modemTabAnchorItem.setEnabled(true); + this.modemTabAnchorItem.setEnabled(!interfaceNotEnabled); this.modemAntennaTabAnchorItem.setEnabled(isModemLTE()); insertTab(this.modemTabAnchorItem); @@ -389,8 +389,6 @@ private void removeOptionalTabs() { this.visibleTabs.remove(this.net8021xTabAnchorItem); this.visibleTabs.remove(this.dhcp4NatTabAnchorItem); this.visibleTabs.remove(this.modemTabAnchorItem); - this.visibleTabs.remove(this.modemGpsTabAnchorItem); - this.visibleTabs.remove(this.modemAntennaTabAnchorItem); } private void refreshAllVisibleTabs() { diff --git a/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java b/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java index cb74bacba13..453a1b950bb 100644 --- a/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java +++ b/kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java @@ -434,15 +434,12 @@ public boolean isValid() { @Override public void setNetInterface(GwtNetInterfaceConfig config) { - logger.info("Start setNetInterface"); - setDirty(true); if (this.tcpStatus == null || this.selectedNetIfConfig != config) { this.tcpStatus = this.tcpTab.getStatus(); } if (config instanceof GwtWifiNetInterfaceConfig) { this.selectedNetIfConfig = (GwtWifiNetInterfaceConfig) config; - logger.info("Selected ifconfig: " + selectedNetIfConfig.getProperties()); this.activeConfig = this.selectedNetIfConfig.getActiveWifiConfig(); if (Objects.nonNull(this.activeConfig)) { @@ -456,8 +453,6 @@ public void setNetInterface(GwtNetInterfaceConfig config) { } loadCountryCode(); } - - logger.info("Finished setNetInterface"); } private void updateChanneList(GwtWifiConfig config) {