KaotoIO / kaoto-ui

Frontend for the Kaoto project to provide an easy-to-use integration framework based on Apache Camel.
https://www.kaoto.io
Apache License 2.0
89 stars 44 forks source link

Prefill default values in kamelet forms #1154

Closed tplevko closed 1 year ago

tplevko commented 1 year ago

Please describe the feature that you want to propose

In Kamelet specifications there are also "default" values set for certain properties - most common db server ports. This prefilled values could provide some guidance for the users.

Screenshot from 2023-01-24 10-29-59

Delawen commented 1 year ago

Wouldn't it be better to have the source code and the forms with less information? Asking just because as a developer to me it makes sense to have a less verbose experience. But that may be me.

kahboom commented 1 year ago

@Delawen we can always have a "clear" button too, to delete default values, because otherwise what would be the point of default values if we don't provide them?

Another benefit might be that we can use it for validation, as discussed in this PR: https://github.com/KaotoIO/kaoto-ui/pull/1216. So, for example, when one of the fields is required, right now we can only show an asterisk* to show it's required, but there's really no validation since we don't have a save button, however, if we fill the default values then we can highlight it in red if the user deletes those values, to show that they are required.

Tomas also mentioned the deploy button could also show the validation, if possible. We can discuss this with UX.

apupier commented 1 year ago

With Kaoto backend 0.6.2, the path parameters are filled with null instead of the default values.

Delawen commented 1 year ago

, when one of the fields is required, right now we can only show an asterisk* to show it's required, but there's really no validation since we don't have a save button,

Why don't we have a save button? On step extensions we have a save button. Why must be the default tab config different? That must be confusing to the user, both default config and step extensions should play with the same rules.

because otherwise what would be the point of default values if we don't provide them?

The default value is the value the integration framework will use if it comes empty from the flow definition.

kahboom commented 1 year ago

With Kaoto backend 0.6.2, the path parameters are filled with null instead of the default values.

@apupier - Do you know if an issue already exists in the backend for this?

Why don't we have a save button?

@Delawen - Because when we first designed Kaoto we didn't have any kind of save function, everything was meant to be in sync automatically when the user types (same for the code editor). Now that the code editor has a sync button maybe it makes sense to change this.

On step extensions we have a save button. Why must be the default tab config different? That must be confusing to the user, both default config and step extensions should play with the same rules.

Yes that's true, but I don't know why step extensions don't have a save button if the default config didn't, as that was created first.

The default value is the value the integration framework will use if it comes empty from the flow definition.

We will need them for this enhancement and also for #1307.

tplevko commented 1 year ago

Just created a PR with the default values taken from the connector definition and inserted into the form. In case this is not the approach we want to take, it still can be reevalueted with UX.