StackStorm / st2web

StackStorm Web UI
http://www.stackstorm.com/features
Apache License 2.0
102 stars 83 forks source link

Workflow composer displays blank if array field is a YAQL expression #901

Closed amanda11 closed 3 years ago

amanda11 commented 3 years ago

When you have a workflow that calls an action that has an array parameter, but you pass in a yaql expression, you get a blank screen when you click on that action.

Update so that if the value passed to an arrayfield is a YAQL expression (ie. starts with <% and ends with %>) that it won't try and split on , and just return as is. i.e. the same logic it performs with Jinja expressions. As if a YAQL expression was found before then it would fail as it didn't have an array to split on.

Resolves #855

amanda11 commented 3 years ago

Verified with packs.install workflow that if select download_pack that would previously go to blank screen, that with this fix that it doesn't blank screen anymore. Need to do more verification to check that it has stopped the ability to enter "value2","value3" and it convert to array etc.

amanda11 commented 3 years ago

Verified that behaviour on action input is unchanged, e.g.

amanda11 commented 3 years ago

Performed some more validation, e.g. in Workflow Composer:

BUT got a problem, in you have a string parameter such as param1, and then in the workflow definition need to pass an array. If you enter ["<%ctx().param1%>]" in the YAML directly then its all good, but it then gets shown in the input view without the []. But then if you then edit it - so on the input view you have <% ctx().param2 %>, when you do save it will not put back the [].

amanda11 commented 3 years ago

Thanks @m4dcoder.