Skip to content

Commit 1b5eb8e

Browse files
#1896362: [Test]When click More Settings when creating a Function App, the OK button does not work.
1 parent 9a03d6e commit 1b5eb8e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/AzureIntegerInput.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ public class AzureIntegerInput extends BaseAzureTextInput<Integer> {
2828
@Override
2929
public Integer getValue() {
3030
final String text = getText();
31-
if (StringUtils.isBlank(text) || !StringUtils.isNumeric(text)) {
31+
if (StringUtils.isBlank(text)) {
32+
return getDefaultValue();
33+
}
34+
try {
35+
return Integer.parseInt(text);
36+
} catch (final Exception e) {
3237
throw new AzureToolkitRuntimeException(String.format("\"%s\" is not an integer", text));
3338
}
34-
return Integer.valueOf(getText());
3539
}
3640

3741
@Override
@@ -41,6 +45,9 @@ public void setValue(final Integer val) {
4145

4246
@Nonnull
4347
public AzureValidationInfo doValidate(Integer value) {
48+
if (Objects.isNull(value)) {
49+
return AzureValidationInfo.none(this);
50+
}
4451
if (Objects.nonNull(minValue) && Objects.nonNull(maxValue) && (value < minValue || value > maxValue)) {
4552
return AzureValidationInfo.error(String.format("Value should be in range [%d, %d]", minValue, maxValue), this);
4653
} else if (Objects.nonNull(minValue) && value < minValue) {

PluginsAndFeatures/azure-toolkit-for-intellij/src/main/java/com/microsoft/azure/toolkit/intellij/appservice/AppServiceMonitorPanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ private void createUIComponents() {
153153
txtRetention = new AzureIntegerInput();
154154
txtRetention.setMinValue(0);
155155
txtRetention.setMaxValue(99999);
156+
txtRetention.setDefaultValue(0);
156157
txtRetention.setRequired(false);
157158
}
158159

0 commit comments

Comments
 (0)