Open miyoyo opened 4 years ago
Currently, when passing something such as:
notify_user: action: msexchange.send_email input: log_level: DEBUG body: "<% ctx().email_body %>" subject: "<% ctx().subject %>" to_recipients: <% ctx().to_recipients %>
Where to_recipients expects a list, even if the YAQL query returns a list, react fails to render and the screen goes permanently white until a full page reload.
The error happens here: https://github.com/StackStorm/st2flow/blob/d7490794f78fb3f720d16b685464e1ace93615be/modules/st2-auto-form/fields/array.js#L101
The exact error is
From what I understand, the method just does not expect that v could be a bad string.
v
A quick fix would be to do a type check before attempting to return a value.
toStateValue(v) { if (jsonCheck(v)) { return JSON.stringify(v); } if (isJinja(v)) { return v; } const { secret } = this.props.spec || {}; if (secret && v && !Array.isArray(v)) { return v; } if(v == null) { return ''; } if(!Array.isArray(v)) { // "Invalid Value" } return v.join(', '); }
Currently, when passing something such as:
Where to_recipients expects a list, even if the YAQL query returns a list, react fails to render and the screen goes permanently white until a full page reload.
The error happens here: https://github.com/StackStorm/st2flow/blob/d7490794f78fb3f720d16b685464e1ace93615be/modules/st2-auto-form/fields/array.js#L101
The exact error is
From what I understand, the method just does not expect that
v
could be a bad string.A quick fix would be to do a type check before attempting to return a value.