Skip to content

Commit eb11af5

Browse files
Merge pull request #6127 from microsoft/fix-1896362
#1896362: [Test]When click More Settings when creating a Function App, the OK button does not work.
2 parents 0d336db + 79f7aab commit eb11af5

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-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/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/component/AzureFileInput.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*/
5+
56
package com.microsoft.azure.toolkit.intellij.common.component;
67

78
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
89
import com.microsoft.azure.toolkit.intellij.common.AzureFormInputComponent;
10+
import com.microsoft.azure.toolkit.intellij.common.AzureTextInput;
911

1012
public class AzureFileInput extends TextFieldWithBrowseButton implements AzureFormInputComponent<String> {
13+
public AzureFileInput() {
14+
super(new AzureTextInput());
15+
((AzureTextInput) this.getTextField()).addValueChangedListener(this::fireValueChangedEvent);
16+
this.trackValidation();
17+
}
18+
1119
@Override
1220
public String getValue() {
1321
return this.getText();

0 commit comments

Comments
 (0)