Skip to content

Commit 1856b9b

Browse files
fix(ui): initialize unconfigured wireless interface to resolve NPE, fix channel selection on hardware tab, fix validation message on empty password [backport release-5.6.0] (#5956)
fix(ui): backport of eclipse-kura/kura-management-ui#11 Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com>
1 parent 8d78486 commit 1856b9b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2011, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -1820,7 +1820,7 @@ private void updateChannelListValues(List<GwtWifiChannelFrequency> freqChannels)
18201820
if (this.activeConfig != null && this.activeConfig.getChannels() != null
18211821
&& !this.activeConfig.getChannels().isEmpty()) {
18221822
this.netTabs.hardwareTab.channel
1823-
.setText(this.channelList.getItemText(this.activeConfig.getChannels().get(0)));
1823+
.setText(this.channelList.getItemText(selectedChannelValue));
18241824

18251825
this.channelList.setSelectedIndex(selectedChannelValue);
18261826
}

kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/validator/GwtValidators.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2021, 2024 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2021, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -51,9 +51,9 @@ private GwtValidators() {
5151
public static List<Validator<String>> newPassword(final GwtConsoleUserOptions userOptions) {
5252

5353
final List<Validator<String>> defaultValidators = Arrays.asList(
54+
nonEmpty(MSGS.pwdEmpty()),
5455
stringLength(255, MSGS.pwdMaxLength()),
55-
noWhitespaceCharacters(MSGS.pwdWhitespaceCharacters()),
56-
nonEmpty(MSGS.pwdEmpty()));
56+
noWhitespaceCharacters(MSGS.pwdWhitespaceCharacters()));
5757

5858
return Stream
5959
.concat(PasswordStrengthValidators.fromConfig(userOptions, new PasswordStrengthValidators.Messages() {

kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/shared/model/GwtWifiNetInterfaceConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2020 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2011, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -110,7 +110,8 @@ public void setWifiConfig(GwtWifiConfig wifiConfig) {
110110

111111
public GwtWifiConfig getActiveWifiConfig() {
112112
GwtWifiWirelessMode wifiMode = getWirelessModeEnum();
113-
GwtWifiConfig activeConfig = null;
113+
GwtWifiConfig activeConfig = new GwtWifiConfig();
114+
activeConfig.setWirelessMode(wifiMode.name());
114115

115116
if (wifiMode.equals(GwtWifiWirelessMode.netWifiWirelessModeAccessPoint)) {
116117
activeConfig = this.m_accessPointWifiConfig;

0 commit comments

Comments
 (0)