KaotoIO / kaoto

Next version of the UI of the Kaoto project
Apache License 2.0
22 stars 21 forks source link

fix(CanvasForm): Expression field shows `[object Object]` #1077

Closed lordrip closed 1 month ago

lordrip commented 1 month ago

Context

When a new expression-aware step is generated, the expression property is created as follows:

        setHeader:
          id: setHeader-1234
          expression:
            simple:
              expression: {}

Notice the expression: {} bit which causes for the expression TextField to render [object Object]

Changes

Replace the autogenerated step with an empty simple: {}, so there's the feedback that a property is left to be configured. In the future, there will be the same feedback in the Canvas as well. https://github.com/KaotoIO/kaoto/issues/705

        setHeader:
          id: setHeader-1234
          expression:
            simple: {}

Note

This comes from this PR https://github.com/KaotoIO/kaoto/pull/1068, in which I suggested using expression: {} for the newly created step.

fix: https://github.com/KaotoIO/kaoto/issues/1076

apupier commented 1 month ago

if I understand well, for the setBody, when inserting the element, it is setting the body to empty string ad there won't be any message to tell user to configure the field. It sounds better to not have any values in this case. Because I fear that a lot of users will forget to modify it and will not understand why the body is "lost".

lordrip commented 1 month ago

if I understand well, for the setBody, when inserting the element, it is setting the body to empty string ad there won't be any message to tell user to configure the field. It sounds better to not have any values in this case. Because I fear that a lot of users will forget to modify it and will not understand why the body is "lost".

Updated

lhein commented 1 month ago

Although we did not yet implement any check if the expression is filled, the behavior now is that just simple is selected and the expression is empty. This will make it easier to spot the missing bit once we have the validation ready.

apupier commented 1 month ago

current behavior is that:

Slightly better than empty string but still not ideal.