Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.

Using a YAQL templating string instead of a list causes the entire web UI to crash #386

Copy link
Copy link

Description

@miyoyo
Issue body actions

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:

return v ? v.join(', ') : '';

image

The exact error is
image

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.

  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(', ');
  }
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.