Skip to content

Commit

Permalink
[argocd] placeholder extractor can set required and tooltip flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rmannibucau committed Dec 26, 2023
1 parent 469ece5 commit 58f5036
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,23 @@ public CompletionStage<?> execute() {
json::createArrayBuilder,
(a, p) -> {
final var conf = json.createObjectBuilder()
.add("name", p.getName());
.add("name", p.getName())
.add("title", p.getName());
if (p.getDefaultValue() != null) {
conf.add("string", p.getDefaultValue());
conf.add("required", false)
.add("string", p.getDefaultValue());
} else if (p.getDefaultValues() != null) {
conf.add("string", String.join(",", p.getDefaultValues()));
conf.add("required", false)
.add("string", String.join(",", p.getDefaultValues()));
} else {
conf.add("required", true);
}

final var desc = descriptions.getProperty(p.getName());
if (desc != null) {
conf.add("tooltip", desc);
}

a.add(conf);
},
JsonArrayBuilder::addAll,
Expand Down

0 comments on commit 58f5036

Please sign in to comment.