StackStorm / st2web

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

Allow integer fields with YAQL expressions to be saved #910

Closed amanda11 closed 2 years ago

amanda11 commented 3 years ago

If we have an action that requires an integer or number as a parameter, and then we have a workflow that calls that action. Currently if we put a YAQL expression such as <% ctx().int_param %> as the value for the parameter, we will get an error stating that it is not a valid integer or float. Update the workflow composer so that it handles integer parameters and numbers with YAQL in the same way it handles Jinja.

Similar change made for objects. No change needed for booleans, but to put in YAQL or Jinja with booleans have to code to the YAML view.

pradnya-orchestral commented 3 years ago

@amanda11 , @m4dcoder has asked me to check your changes, one point is, in action details page if integer field value is available ,we have added ranges for timeout and limit field and as per the ranges we are enabling and disabling run button. We have added condition for run button. I have tried your changes, now it is not giving error for YAQL expression but run button is disabled . So if user has entered YAQL expression for integer or number field we have to add appropriate condition for run button so we can enable that.

amanda11 commented 3 years ago

@pradnya-orchestral @m4dcoder Thanks for the review comments, I have updated the disabled to check whether its an expression and don't disable if it is. For expression checking I've added YAQL and Jinja, as the change to put the check on value, had stopped Jinja expressions such as {{ st2kv.system.int_param }} from being used (which could be used on other integers fields as a Run parameter).