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

UI is not handling `END` branch steps #1587

Open kahboom opened 1 year ago

kahboom commented 1 year ago

Describe the Bug

The frontend is not handling steps within a branch that are END steps (such as stop), and if you add one via YAML it causes the integration to break (see screenshots).

We currently treat steps that are available as either MIDDLE or END steps as MIDDLE steps, but sometimes we have steps that are only available as END steps. At the moment, there is only one example of such a step, and that's the stop step.

Right now, we are changing the stop step to be a MIDDLE step so as to not break the UI, but eventually we will need to handle these step types as END steps, to provide a better UX on the frontend. For example, if a branch that has a stop step should not have anything after it unless there is some other execution flow available (i.e. another branch).

Relates to https://github.com/KaotoIO/kaoto-ui/issues/1562 and https://github.com/KaotoIO/kaoto-backend/issues/586

Steps to Reproduce the Bug or Issue

Paste the following YAML into the source code editor.

- from:
    uri: activemq:queue:null
    steps:
    - choice:
        when:
        - steps:
          - to:
              uri: activemq:queue:null
          - stop: {}
        - steps: []
        - steps: []
    - to:
        uri: avro:null:null:null/null

Screenshots or Videos

image

image

Platform

igarashitm commented 1 year ago

NOTE: when this issue is addressed, rollback the workaround below at the backend side https://github.com/KaotoIO/kaoto-backend/pull/594/files#diff-87309ed5366bcfcada0b99b6ced77c2ed20b2b661ab9f3d6868ae1e7348c4f38R442-R444 https://github.com/KaotoIO/kaoto-backend/pull/594/files#diff-879e07830bfa8e5c837cc326b4c7c3aacfa0f723296f464cf0dcca8ee338f415R40-R44