-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
others(element-template-generator): 902 template generator generate dropdown choices automatically #3982
others(element-template-generator): 902 template generator generate dropdown choices automatically #3982
Conversation
5948f2e
to
da58727
Compare
...email/src/main/java/io/camunda/connector/email/outbound/protocols/actions/SortFieldImap.java
Outdated
Show resolved
Hide resolved
...mail/src/main/java/io/camunda/connector/email/outbound/protocols/actions/ImapListEmails.java
Outdated
Show resolved
Hide resolved
5c80663
to
6fa9461
Compare
...ator/core/src/main/java/io/camunda/connector/generator/java/util/TemplatePropertiesUtil.java
Outdated
Show resolved
Hide resolved
...e-generator/core/src/main/java/io/camunda/connector/generator/java/annotation/EnumLabel.java
Outdated
Show resolved
Hide resolved
connectors/jdbc/element-templates/hybrid/jdbc-outbound-connector-hybrid.json
Outdated
Show resolved
Hide resolved
connectors/google/google-gemini/element-templates/google-gemini-outbound-connector.json
Outdated
Show resolved
Hide resolved
String value(); | ||
|
||
String label(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments for what these values will be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do it.
@sbuettner
Btw, as value
represents the value as it will be inside the variables, is it really necessary, we could use the Enum value itself, don't you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, lets remove the value
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mathias-vandaele Maybe we can call the annotation @EnumValue
instead of "label" to make it more clear? cc @johnBgood
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might even be DropdownItem{label= "the label", default="true"}
. We then have everything in 1 single place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnBgood I made all the changes. The only issue with managing the default value within the @enumLabel is that it conflicts with the defaultValue inside ElementTemplate.
Do you think we can merge this current version? I removed the value, renamed enumLabel to enumValue, and added this annotation to a couple of connectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue with managing the default value within the @enumLabel is that it conflicts with the defaultValue inside ElementTemplate.
I don't get this part, but I trust you to make the best decision 👌
@mathias-vandaele Would be great if you can migrate 1-2 additional Connectors as well to see whether the implementation leads to the expected results. |
ada930f
to
8d1dec0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @mathias-vandaele.
I generally like @johnBgood proposal of calling it DropdownItem
. We also have DropdownChoice
as well. No hard feelings from my side.
7a0c374
to
7ae05bf
Compare
@JsonEnumDefaultValue | ||
@DropdownItem(label = "PLAIN", order = 0) | ||
PLAIN("text/plain; charset=utf-8"), | ||
@DropdownItem(label = "HTML", order = 1) | ||
HTML("text/html; charset=utf-8"), | ||
@DropdownItem(label = "HTML & Plaintext", order = 2) | ||
MULTIPART("multipart/mixed; charset=utf-8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use the order returned by Enum.values()
instead of requiring to define it.
7ae05bf
to
ed29f06
Compare
…his annotation to other connetors
…his annotation to other connetors
…his annotation to other connetors
ed29f06
to
c216a8b
Compare
Description
It brings an easy way of creating dropdown using the
@elementTemplate
annotationI tried to follow the way @johnBgood wanted it here
Related issues
closes #https://github.com/camunda/team-connectors/issues/902
Checklist
no milestone
label.