Skip to content

Commit

Permalink
Make config variable optional
Browse files Browse the repository at this point in the history
  • Loading branch information
KavinduZoysa committed Jan 28, 2025
1 parent 8cc9dec commit abdd843
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.gson.JsonElement;
import io.ballerina.compiler.api.SemanticModel;
import io.ballerina.compiler.api.symbols.Qualifier;
import io.ballerina.compiler.syntax.tree.ExpressionNode;
import io.ballerina.compiler.syntax.tree.ModulePartNode;
import io.ballerina.compiler.syntax.tree.ModuleVariableDeclarationNode;
import io.ballerina.compiler.syntax.tree.Node;
Expand All @@ -43,6 +44,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
* Manage the configurable variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ public FormBuilder<T> defaultableVariable(ExpressionNode expr) {
.stepOut()
.value((expr != null && expr.kind() != SyntaxKind.REQUIRED_EXPRESSION) ? expr.toSourceCode() : "")
.type(Property.ValueType.EXPRESSION)
.optional(true)
.editable();
addProperty(Property.DEFAULTABLE_KEY, expr);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"valueType": "EXPRESSION",
"value": "",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -112,7 +112,7 @@
},
"valueType": "EXPRESSION",
"value": "",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"valueType": "EXPRESSION",
"value": "10",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -112,7 +112,7 @@
},
"valueType": "EXPRESSION",
"value": "",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"valueType": "EXPRESSION",
"value": "10",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -112,7 +112,7 @@
},
"valueType": "EXPRESSION",
"value": "\"new config\"",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"valueType": "EXPRESSION",
"value": "10",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -112,7 +112,7 @@
},
"valueType": "EXPRESSION",
"value": "\"new config\"",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -171,7 +171,7 @@
},
"valueType": "EXPRESSION",
"value": "10",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -230,7 +230,7 @@
},
"valueType": "EXPRESSION",
"value": "\"new config\"",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"valueType": "EXPRESSION",
"value": "10",
"optional": false,
"optional": true,
"editable": true,
"advanced": false
}
Expand Down Expand Up @@ -112,7 +112,7 @@
},
"valueType": "EXPRESSION",
"value": "12.4",
"optional": false,
"optional": true,
"editable": true,
"advanced": false,
"diagnostics": {
Expand Down Expand Up @@ -183,7 +183,7 @@
},
"valueType": "EXPRESSION",
"value": "\"welcome\"",
"optional": false,
"optional": true,
"editable": true,
"advanced": false,
"diagnostics": {
Expand Down Expand Up @@ -254,7 +254,7 @@
},
"valueType": "EXPRESSION",
"value": "23",
"optional": false,
"optional": true,
"editable": true,
"advanced": false,
"diagnostics": {
Expand Down

0 comments on commit abdd843

Please sign in to comment.